merge branch that was created from old commit to master

ⅰ亾dé卋堺 提交于 2019-12-11 07:09:40

问题


I created a new branch from old master-commit. When trying to merge it with master using

git checkout master
git merge newbranch

I am getting

Already up to date

although it is a different code.

Of course there is an option to go back several commits (using git reset) but this is not what I am looking for. I want to push/merge the newly created branch to master.

What is the best way to do that?


回答1:


You need to go back to the master branch (git checkout master) and then merge in your new branch (git merge <newbranch>). That will pull over the changes from that branch into your master branch.

Read more here: http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging



来源:https://stackoverflow.com/questions/18851027/merge-branch-that-was-created-from-old-commit-to-master

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!