I'm confused about how merges work. I had a situation today where I tried to rebase my code and it told me I had to manually merge some changes. So I was able to do that in visual Studio 2015. Then I tried saying "git add [myfile]" and that seemed to work. Then I tried "got rebase --continue".
That's when things got confusing. It said: "WebAPI/Controllers/FileUploadController.cs: needs update. You must edit all merged conflicts and then mark them as resolved using git add." <-- But there were no conflicts in FileUploadController.cs. I only removed a reference to System.Web.Http.Cors.
So I said: git add FileUploadController.cs. Seemed to work. Then I said: git rebase --continue. It complained again saying the same thing.
So then I tried undoing my changes to FileUploadController.cs. I said: git rebase --continue. This time it spat out the following error message:
"Applying: fixed unit test
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.
When you have resolved this problem, run 'git rebase --continue'.
If you prefer to skip this patch, run 'git rebase -skip' instead.
To check out the original branch and stop rebasing, run 'git rebase --abort'."
Finally, I said: git rebase --skip, and that seemed to solve the problem.
So my question is: why is continuing rebase so bloody difficult after a merge? Why does it get so confused? There were absolutely no conflicts in FileUploadController.cs. It wouldn't even let me commit my changes to it. What's a guy supposed to do?
I'm really dismayed that there are no answers to this HUGE issue. If I do a right-click and "rebase current changes onto master" in Sourcetree, and then have conflicts, there seems to be no way to finish the process in Sourcetree. The only way I can figure it out (if and when I remember) is to resolve the conflicts using my external tool (BeyondCompare) then go to the command line and do "git rebase --continue", then go back into Sourcetree and do a force push of the branch I rebased.
Why doesn't Sourcetree have a visual equivalent of "git rebase --continue"?
I found a good explanation here:
"Here, HEAD is the other branch version, not the one that is checked out."
"The error message is not very intuitive, but it does contain the answer. We just need to tell rebase to skip this patch. It’s also not necessary to fix the conflict markers in the file. You will end up with the file version from the branch you are rebasing on."
Free training for Jira, Confluence, and Jira Service Management Start faster and be more productive with Atlassian cloud products. Take the guess work out of where to begin, and gain confidence wi...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events