Why do I have to resolve the same "git rebase" conflict over and over?
Solution 1:
What you want is git rerere
which records conflict resolutions for you. The best introduction to this I have seen is now part of the Git Book, Tools chapter. In practice when you perform a rebase, you will end up stopping as before but you only have to check the merge conflict remains resolved then git add
it and continue.
Solution 2:
You should not be getting the same conflict over and over. Rerere will not help you here. It simply means that the codebase that you are trying to replay commits over is so different that each commit needs your help to adjust it. This is one of the reasons to favour merge over rebase. In my opinion, rebase should be used only if necessary and not part of your regular workflow. Rerere will help a lot more in a merge/reset type workflow. Here is my workflow that avoids rebasing: http://dymitruk.com/blog/2012/02/05/branch-per-feature/
One way to ease some of the pain is to use a smart merging program like Beyond Compare. It is syntax aware and will solve quite a few conflicts that Git will (rightfully) refuse to do for you. Many times, these tools, when invoked, won't even open their UI, solve the issue and allow your git mergetool
command to continue on to the next conflict. Remember to set "trust mergetool exit code" to true.