Skip to content

Instantly share code, notes, and snippets.

@himat
Created April 18, 2020 23:51
Show Gist options
  • Save himat/09f08b8927af50f6232ebaa93db8f215 to your computer and use it in GitHub Desktop.
Save himat/09f08b8927af50f6232ebaa93db8f215 to your computer and use it in GitHub Desktop.
[Useful git tips] Things for git #git

Aborting Git Commits And Rebases

When you are amending a commit or doing an interactive rebase of a series of commits, Vim will open and when you close the file, git will continue with the procedure. But if you want to cancel the commit or rebase?

Vim allows you to quit with an error code.

:cq

This means that irrespective of the content of the buffer, Vim will signal to Git with an error code to not process the commit or rebase, effectively aborting the action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment