Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - How to merge a remote branch into remote master

Tags:

git

github

So here's the situation.

I created a local branch. Then I pushed that local branch to github. So github now has two branches.

Now I want to merge the two branches together both locally and on github.

This is probably a dumb question but somehow I'm not seeing it in the documentation.

So far my best guess is to merge locally, and then delete the remote branch from github?

like image 335
Greg Avatar asked Jan 23 '12 13:01

Greg


People also ask

How do I merge branches in remote repository?

The idea here, is to merge "one of your local branch" (here anotherLocalBranch ) to a remote branch ( origin/aBranch ). For that, you create first " myBranch " as representing that remote branch: that is the git checkout -b myBranch origin/aBranch part. And then you can merge anotherLocalBranch to it (to myBranch ).


2 Answers

You create a merge of your feature branch locally, push the branch you merged to (probably "master") to github. Github will now contain the merge. Then delete your local and remote copy of the feature branch.

like image 133
Hiery Nomus Avatar answered Oct 03 '22 01:10

Hiery Nomus


Just merge the branch locally into the master branch and push that to github's master branch.

like image 26
Mark Fisher Avatar answered Oct 03 '22 02:10

Mark Fisher