Why does a successful merge break my code?
When using XCode4 I created a new branch and implemented a very small method on this new branch. I saw that the branch was working properly so I made a commit on this new branch and then switched back to my main branch. I merged the two branches开发者_开发技巧 together (the new one into my main branch). Now my project is not working.
The exact same thing happened yesterday. I never found the problem so I started over from the beginning on this current project. What is causing this?
It depends on where you started your development branch:
if that was from
HEAD
ofmain
branch, then the merge back intomain
should have been a fast-forward one (i.e.main HEAD
should have simply be moved atdev HEAD
), and your project should have worked.if that was from any commit before
main HEAD
(i.e. ifmain HEAD
has moved duringdev
branch development), then the merge isn't a fast forward one, and you are combining (automatically if the changes in both branches are separate) two different sets of changes.
Then the result needs to be tested and validated again.
精彩评论