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 – resume your work from anywhere using CLI mode


Now let's enter the second phase, where we would like to resume our work from a remote machine.

There are only three stages involved here.

  1. Clone the repository from the server.

    git clone https://[email protected]/raviepic3/online_workbench.git /path/where/you/would/like/the/clone_to_be
    
  2. Make your changes to the files needed.

  3. Add/stage the modifications made in files, commit, and push.

    git add *
    git commit –m 'Your commit message'
    git pull
    git push
    

    Tip

    As an alternative to git pull, we can also use git fetch followed by git merge @{u}.

What just happened?

We just practiced a working solution for maximizing productivity by effectively handling situations as described in Scenario 1.

Git add * stages/adds all your changes, which is confirmed and recorded by the git commit command. Git pull is used to check whether there are unsynced updates in the server; if present, they are synced appropriately followed by git push, which updates...