Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git revert --continue stuck never finishes

Tags:

git

revert

I did a git revert {commithash} in my project to go to a previous feature deployed. The merge was resolved, all the changes were added and I got into the status:

On branch develop

You are currently reverting commit {commithash}.
(all conflicts fixed: run "git revert --continue").

(use "git revert --abort" to cancel the revert operation)

nothing to commit, working tree clean

I use git revert --continue and nothing happens, and I still am in the state of pending revert... Anyone knows what has gone wrong? Thanks.

like image 462
Bruno Calça Avatar asked Nov 30 '25 04:11

Bruno Calça


1 Answers

When you get that "nothing to commit" message, it means that while resolving the conflicts, you chose the code that was already in the latest commit. The end result is that your revert makes no changes to the state of the code. The git revert --continue you're trying to issue can't finish the revert.

You can, if you really want to, use git commit --allow-empty to commit this revert even though it does nothing at all. Having done that, you can then use git revert --abort to terminate the reversion process.

It's usually a mistake to make a "no changes" commit like this one: it means that your git revert did not accomplish anything, so one has to wonder why you bothered.

like image 85
torek Avatar answered Dec 01 '25 16:12

torek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!