Saturday, June 13, 2015

Remote Repository vs Local Repository GIT

Remote Repository is the Central Location of the code. We can clone remote repo into a local repo and start working on local. This local can be synched from time to time with the remote repo. We can push changes from local to remote.

Local repository is the cloned copy of the remote repo. All Version control functions are applicable to the local repo. We can create branch on a local repo. This branch will not be visible to remote, neither will have the parent in the remote. Local branches can be merged with local if required and local in-turn can push the changes to remote.

Putting changes to remote
This is a multi-step process. First changes are moved to the staging area, which is then committed to local. The local is then pushed to remote. Thus we commit to local and not to remote.  git add and git commit are two commands for that.

No comments:

Post a Comment