Synchronization: remote, push, pull

Synchronization: remote, push, pull #

List remotes #

To list the remote(s) associated to your repository (name and address of each remote), you can run

git remote -v

Upload #

If the current branch is already shared with a remote, you can upload it with

git push

Otherwise, you can share this branch (and its commits) with

git push -u <remoteName> <branchName>

To delete a remote branch, run

git push <remoteName> -d <branchName>

Alternatively, you can delete a remote branch using the web interface of your hosting service.

Download #

If your current branch is shared with your remote, you can update your local copy with

git pull

Warning. When pulling, git will try to perform a fast-forward merge of the remote branch into your local copy. If you follow the basic workflow presented earlier, then this fast-forward merge should succeed. If it does not, then git will suggest you a command to perform a classical merge instead.