Book Image

Git: Version Control for Everyone

By : Ravishankar Somasundaram
Book Image

Git: Version Control for Everyone

By: Ravishankar Somasundaram

Overview of this book

<div> <div>Git – is free software which enables you to maintain different versions of single or multiple files present inside a directory(folder), and allows you to switch back and forth between them at any given point of time. It also allows multiple people to work on the same file collaboratively or in parallel, without being connected to a server or any other centralized system continuously.<br /><br />This book is a step by step, practical guide, helping you learn the routine of version controlling all your content, every day. <br /><br />If you are an average computer user who wants to be able to maintain multiple versions of files and folders, or to go back and forth in time with respect to the files content – look no further. The workflow explained in this book will benefit anyone, no matter what kind of text or documentation they work on.<br /><br />This book will also benefit developers, administrators, analysts, architects and anyone else who wishes to perform simultaneous, collaborative work, or work in parallel on the same set of files. Git's advanced features are there to make your life easier.<br /><br /><br /><br /><br /><br /></div> </div>
Table of Contents (16 chapters)
Git: Version Control for Everyone Beginner's Guide
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – getting ready to share


To keep things clear and simple we shall start with a fresh instance with minimal data, so that the changes are evident.

  1. Let's create a new directory and call it collab_source.

  2. Within the directory create a new text file called mycontent.txt.

  3. Open up the text file that you just created, and enter the following:

    Unchanged first line from source
    Second line
    Third line
    
  4. Save and close the file.

  5. Now make the collab_source directory a Git repository; then add the file mycontent.txt and make a commit with a commit message saying "Base commit from source".

  6. Now this copy will reside in your machine for your own manipulation. Let's create a bare repository from your copy to put it in a common place from where your team members can clone it to have their own copy of the files.

  7. For creating a bare clone of your existing repository, use the following command:

    git clone --bare /your/path/to/collab_source /your/path/to/bare_collab
    

Note

For this example, to convey the...