问题
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