Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm new to git as a version control system. I tried reading the documentation, but I don't understand what "master" means in the command "git push origin master".

Can someone explain in very dumbed-down terms?


share|improve this question
up vote 5 down vote accepted

This is the Master branch. The main tree of your control system.

push = push your changes to the remote server
origin = remote Server origin
master = Master branch

If you have another remote branches you have something like "git push origin test" then you push your changes to the test remote branch.

share|improve this answer
git push origin test pushes the local test branch to origin/test. Just in case somebody was expecting the current branch to get pushed. – JonnyJD Dec 22 '12 at 17:41

That master is the <src> part of a refspec.

This means that your local master branch will be pushed to the master branch of the remote origin (orgin/master).

If you would have specified

git push origin master:my_work

then you would have pushed your local master to origin/my_work. If you don't use the :my_work part, then the destination defaults to the same branch as given as source.

Just specifying

git push origin

will push every local branch that has a matching remote branch to that branch per default. Not just the current branch. This is the same as using git push origin :.

You can change this default with git config remote.origin.push HEAD, which would push the current branch to a remote branch with the same name.

See configure-a-local-branch-for-push-to-specific-branch for further details on configuring refspecs and setting push.default.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.