Doing git-push without origin master

Your master branch should be automatically setup so this works. If you are on some other branch, then you can use the git branch command with the --set-upstream option

git branch --set-upstream someBranch origin/master

It might be also the case that you don't have a remote set, in the case when you have a bare and clean repository setup waiting for you to push to it for the first time, e.g. when you are setting up a repo on github. Assuming you have setup your remote you can push to the server with the -u option that will take care of the branch --set-upstream for you:

git push -u origin master

which is the same as:

git push origin master
git branch --set-upstream master origin/master

The default behaviour is defined by the push.default configuration setting.

If you do a search for push.default on http://git-scm.com/docs/git-config you'll find an explanation for its various options.

Tags:

Git

Git Push