tags:

views:

36

answers:

2

My working copy is on master branch, how to update from remote server?

Say I working locally on my own custom branch, but I want to update the master with the remote branch, how would I do that?

+1  A: 
git pull origin master

Or if instead of pulling into your local branch, you just wanted to update the branches you have locally that track origin:

git fetch

or

git remote update

if you're tracking multiple remote servers and want to update them all at once.

Brian Campbell
Do not use `git pull <remote> <remote-branch>:<local-branch>` syntax, unless you *really, really, really* know what it would do. Just... don't.
Jakub Narębski
Oops. Yeah, that's wrong. Deleted from my answer.
Brian Campbell
+1  A: 

It's not clear from your description that you understand the difference between "master" (a local branch) and "origin/master" (the master of the origin remote). It's also not clear which you want to update. A simple "git fetch origin" will update "origin/master" to reflect the upstream, but you can't change the local "master" until you check it out.

Randal Schwartz
what do you know about GIT anyhow? :)
mrblah
If you have local "master" branch checked out, then "git pull origin master" (or even simply "git pull origin", or perhaps even "git pull") would update this branch.
Jakub Narębski