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 the server's files with the changes that you have made and committed in your local repository.

Note

You might happen to think why we are doing git pull before git push when our sole intention was to push the updated files to the server. Wonderful question – hold that thought right there; you will get to know more about it when we discuss the concepts of branching.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.103.8