Last Updated on January 30, 2021 by sandeeppote

Git has working directory, Staging Index and local repository. All changes done to the project sits in local repository until it is been pushed to the remote  repository. There are different tools that facilitates to provide code management system using git. One of them is GitHub, you may also use VSTS.

To push or sync the changes to the remote repository, you may clone the changes from remote to your local empty repository or if you have local repository you may add changes to remote repository.

To add changes to remote- github in this case-

git remote add origin remote_repository_url

To remove the remote remote origin-

 git remote rm origin

To clone from the remote-

git clone remote_repository_url

This shall be cloned in the current directory. In case if you want to new directory specify a name-

git clone remote_repository_url directory_name