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 – checking out using CLI mode


  1. Let's learn two more commands to add to your Git lingo.

    Git log
    Git checkout ___commit_id___
    

    Git log is for showing the history of a repository; it gives us information such as commit ID, author, date, and the commit comment given by us.

    We need the commit ID for use later.

    Don't worry about memorizing a sequence of 40 characters. Our magic wand, Git, does the hard work of filling in the remaining characters for you to identify a commit if you supply it with the first five characters.

  2. Let's see it in action.

    Now you have travelled back to a previous commit, and your files will contain the contents of the previous commit. You can view the contents of the file now.

    Note

    When you have checked back to a previous commit you are hanging in the air; any changes to your files now will be lost once you go back to the master. We'll see how to handle this in later chapters with a concept called branching.

  3. To return to the latest changes run git checkout...