git-guide icon indicating copy to clipboard operation
git-guide copied to clipboard

"git push origin master" does not what the guide says it does

Open mbra opened this issue 13 years ago • 2 comments

"git push origin master" does not push the current branch to the "master" branch in the "origin" remote. It pushes the local branch of the specified name to either a remote branch of the same name, or an alternate name if it is specified with the : form of the parameter.

mbra avatar Feb 07 '12 07:02 mbra

I think he's right.

E.g: You are in a local branch named testing and do git push origin master, you will push your commits from your master, to the master on the remote. Ignoring testing at all.

That can introduce some confusion or bugs if misread.

nitrix avatar Feb 07 '12 20:02 nitrix

$ git push REMOTE LOCALBRANCH:REMOTEBRANCH

glennbarrett avatar Dec 17 '13 21:12 glennbarrett