How do I push a local Git branch to master branch in the remote?

picardo picture picardo · Mar 24, 2011 · Viewed 483.7k times · Source

I have a branch called develop in my local repo, and I want to make sure that when I push it to origin it's merged with the origin/master. Currently, when I push it's added to a remote develop branch.

How can I do this?

Answer

mipadi picture mipadi · Mar 24, 2011
$ git push origin develop:master

or, more generally

$ git push <remote> <local branch name>:<remote branch to push into>