Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Why is 'git rebase --continue' so difficult?

Gibran Shah April 26, 2017

Hello,

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?

3 answers

3 votes
Martin Taylor January 23, 2018

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"?

0 votes
Marcello Romani June 29, 2018

 

I found a good explanation here:

http://wholemeal.co.nz/blog/2010/06/11/no-changes-did-you-forget-to-use-git-add/

"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."

0 votes
Michael Solomon March 6, 2018

+1

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events