Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 851
picardo Avatar asked Mar 24 '11 18:03

picardo


People also ask

How do I push a local branch to remote branch?

Push a new Git branch to a remote repo Clone the remote Git repo locally. Create a new branch with the branch, switch or checkout commands. Perform a git push with the –set-upstream option to set the remote repo for the new branch. Continue to perform Git commits locally on the new branch.


1 Answers

$ git push origin develop:master 

or, more generally

$ git push <remote> <local branch name>:<remote branch to push into> 
like image 104
mipadi Avatar answered Oct 15 '22 09:10

mipadi