I have a git repository with 2 branches: master and test.
There are differences between master and test branches.
Both branches have all changes committed.
If I do:
git checkout master
git diff test
A screen full of changes appears showing the differences. I want to merge the changes in the test branch and so do:
git merge test
But get the message "Already up-to-date"
However, examining files under each different branch clearly shows differences.
What's the problem here and how do I resolve it?
解决方案
The message “Already up-to-date” means that all the changes from the branch you’re trying to merge have already been merged to the branch you’re currently on. More specifically it means that the branch you’re trying to merge is a parent of your current branch. Congratulations, that’s the easiest merge you’ll ever do. :)
Use gitk to take a look at your repository. The label for the “test” branch should be somewhere below your “master” branch label.
Your branch is up-to-date with respect to its parent. According to merge there are no new changes in the parent since the last merge. That does not mean the branches are the same, because you can have plenty of changes in your working branch and it sounds like you do.