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

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


$ git push origin develop:master

or, more generally

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


As people mentioned in the comments you probably don't want to do that...The answer from mipadi is absolutely correct if you know what you're doing.

I would say:

git checkout mastergit pull               # to update the state to the latest remote master stategit merge develop      # to bring changes to local master from your develop branchgit push origin master # push current HEAD to remote master branch

 


you can install the git tool https://git-scm.com/downloads and it can help with merging branch to master. I created a branch in RStudio, worked on it, pushed changes to github. Then when I wanted to merge I opened this git GUI tool, navigated to the folder with my repository, then merged the branch to master. I opened RStudio to check if the changes had happened, then pushed to github from RStudio.