Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git rebase --continue won't work

Tags:

git

git-rebase

I did git rebase master, fixed the conflicts reported in a file, and then git add the file to resolve the conflict. Then I did git rebase --continue, and got this:

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

Any idea what I am missing here? Should I do git rebase --skip?

like image 532
Boon Avatar asked Feb 19 '14 18:02

Boon


People also ask

How do I force git to rebase continue?

When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To check out the original branch and stop rebasing run "git rebase --abort".

What happens after git rebase continue?

After issuing git rebase --continue , a commit is made, you will have to inspect that commit. Or, you can issue git status before issuing git rebase --continue to see all those files. But after you've rebased, they're now part of the repository history.

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?

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.


1 Answers

If you are in Mac OS X, then first of all you should disable revisiond, as it can mess with files in your work tree in the middle of rebase, causing unpredictable and broken behavior:

git config --global core.trustctime false 

The issue is explained in this article, and big thanks to @nickfalk who pointed it out.

As for your rebase, this kind of situation is not unusual in practice. Let's try to think through the steps of what's happening:

  • When you rebase the current branch on top of another branch, git moves the HEAD to the other branch, and starts applying the unique commits you have in your current branch.

  • While replaying one of those commits, you reached a conflict. You resolved it, but as a result there are no changes to commit, nothing to replay in this commit.

Practically, this means that you rejected the changes in the current commit being replayed. So, if you don't need anything from this commit, it's normal to skip it. So git rebase --skip makes sense here.

like image 172
janos Avatar answered Sep 29 '22 11:09

janos