You already accepted an answer, but let me add this, with my own emphasis:
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.
Sometimes, while rebasing—which means copying a series of commits—you will find that one of the commits that Git thought was still required, was in fact not required.
Consider, for instance, this situation:
...--o--*--R--S--T <-- master
\
A--B--C <-- feature
(The uppercase letters stand in for commit hash IDs. Newer commits are towards the right. You made commits A
, B
, and C
earlier.) You've decided you would like to git rebase
your feature
onto your master
. If it all went as you'd expect, you would end up with this:
A'-B'-C' <-- feature (HEAD)
/
...--o--*--R--S--T <-- master
\
A--B--C [abandoned]
where A'
is like A
—it makes the same changes, but to commit T
instead of to commit *
—and B'
is like B
and C'
is like C
.
So, git rebase
schedules the copying of A
, then B
, then C
. It detaches HEAD (hence "is in detached mode") at T
and executes the first copy. If all goes well, you now have:
A' <-- HEAD
/
...--o--*--R--S--T <-- master
\
A--B--C <-- feature
Git then proceeds to attempt to copy B
. This copy step fails due to conflicts, leaving you in the state you saw.
You now begin resolving conflicts. Inspecting the first conflict, you see that what what you did in B
is already taken care of by commit S
, so you choose their code from T
, which resulted from their change in S
, rather than your code from B
. Inspecting the second conflict, you see that what you did in B
is already taken care of by commit R
, so you take their code from T
again. This repeats until you have resolved all conflicts, taking no changes from your own B
.
If you now run:
git rebase --continue
your Git will say:
No changes - did you forget to use 'git add'?
No, you didn't forget, you just resolved all conflicts by, in the end, dropping your commit B
. So the bold-text advice above applies and you can just run:
git rebase --skip
to tell Git: Yes, drop my commit entirely, and proceed to attempt to copy C
now. Assuming that copy works, the rebase will finish and you will have:
A'-C' <-- feature (HEAD)
/
...--o--*--R--S--T <-- master
\
A--B--C [abandoned]
which is not quite what you expected originally, but is what you needed after all.