8

From the git-revert(1) manpage it is not clear to me what the exact differences between the quit and abort options of the revert command are.

From my exercises with the revert command I made the observation that the abort option works very similar to the one of the rebase command in that it tries to reconstruct the pre-operational state of the current branch.

Also what are the practical use cases of the quit option?

1 Answer 1

7

From my exercises with the revert command I made the observation that the abort option works very similar to the one of the rebase command in that it tries to reconstruct the pre-operational state of the current branch.

You're on the right track:

  • git revert --abort rolls the sequencer state back, so the workspace and history end up as they were before the start of git revert;
  • git revert --quit only removes the sequencer state, so the workspace and history remain as they are (with a partial revert in progress but forgotten about).

From my quick experimentation, if a revert needs manual intervention, git revert --quit only forgets the previous commits; REVERT_HEAD remains in place so you still need to --continue or --abort. The latter keeps the forgotten commits as a result of the --quit.

As far as use cases go, I've never needed to use --quit, but I'd imagine if you're part-way through a revert and decide you're not going to need the remaining reverts, but you do want to keep those you've committed so far, then it might come in handy...

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.