git-abort
Cancel a conflicted or in-progress operation
TLDR
Abort a Git rebase, merge, or cherry-pick
SYNOPSIS
No standard syntax; typically invoked as git <subcommand> --abort (e.g., git rebase --abort)
DESCRIPTION
There is no official git-abort command in Git. Instead, Git uses the --abort option on specific subcommands to cancel ongoing operations like rebases, merges, cherry-picks, or am applies, restoring the repository to its pre-operation state.
This prevents incomplete operations from leaving the working directory in a broken state. Users sometimes create custom aliases or scripts named git-abort to run common abort sequences, such as git rebase --abort or git merge --abort, depending on context.
Check ongoing operations with git status before aborting.
CAVEATS
Not a built-in Git command; attempting git abort or git-abort will fail with 'unknown subcommand'. Always verify the active operation via git status. Aborting succeeds only if the operation supports it and is in progress.
CUSTOM ALIAS EXAMPLE
Add to ~/.gitconfig:
[alias]
abort = !git rebase --abort 2>/dev/null && git merge --abort 2>/dev/null && git cherry-pick --abort 2>/dev/null
ALTERNATIVES
Use git status to identify operation, then abort specifically. For resets, consider git reset --hard HEAD cautiously.
HISTORY
The --abort option was first added to git-rebase in Git v1.6.0 (2008), then to git-merge in v1.7.4 (2010), and later to other subcommands. No standalone git-abort has ever existed in core Git.
SEE ALSO
git-rebase(1), git-merge(1), git-cherry-pick(1), git-am(1)


