0

I have pushed my local branch "develop" into the remote branch "develop".

Now, I want to merge contents of remote "develop" into remote "master" without going to github website.

I tried to checkout to the remote master by typing git checkout origin/master, but displays "You are in 'detached HEAD' state."

What is the best way to do so?

pintua
  • 63
  • 5
  • Isn't this exactly what you want? http://stackoverflow.com/questions/21651185/git-merge-a-remote-branch-locally – Bikas Jul 11 '15 at 07:56

2 Answers2

3

You can find the answer here.. Git - How to merge a remote branch into remote master.

There is no way you can merge remote branches directly from your local git repo. You have to merge the branch into local master branch and then push the changes to remote master.

Community
  • 1
  • 1
vchethan
  • 113
  • 1
  • 8
1

You could update both branches on your local, merge them, and push to master You might want do the following

git checkout develop

git pull origin develop

git checkout master

git pull origin master

git merge develop

If you have no conflicts, and everything is fine then, update the contents of origin/master with the new changes

git push origin master

This way you can easily merge the contents of origin/develop to origin/master without going to github.

Olalekan Sogunle
  • 2,299
  • 1
  • 20
  • 26