diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2016-11-12 09:00:41 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-12-11 13:51:41 -0800 |
commit | 9512177b68263085fef84cdbd45ecdee7bfe2377 (patch) | |
tree | 669bb556ed96ba389a0f7c3bfe83d663bf21ee96 /Documentation | |
parent | Git 2.8.4 (diff) | |
download | tgif-9512177b68263085fef84cdbd45ecdee7bfe2377.tar.xz |
rebase: add --quit to cleanup rebase, leave everything else untouched
There are occasions when you decide to abort an in-progress rebase and
move on to do something else but you forget to do "git rebase --abort"
first. Or the rebase has been in progress for so long you forgot about
it. By the time you realize that (e.g. by starting another rebase)
it's already too late to retrace your steps. The solution is normally
rm -r .git/<some rebase dir>
and continue with your life. But there could be two different
directories for <some rebase dir> (and it obviously requires some
knowledge of how rebase works), and the ".git" part could be much
longer if you are not at top-dir, or in a linked worktree. And
"rm -r" is very dangerous to do in .git, a mistake in there could
destroy object database or other important data.
Provide "git rebase --quit" for this use case, mimicking a precedent
that is "git cherry-pick --quit".
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-rebase.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 6ed610a031..f89245818f 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -12,7 +12,7 @@ SYNOPSIS [<upstream> [<branch>]] 'git rebase' [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>] -'git rebase' --continue | --skip | --abort | --edit-todo +'git rebase' --continue | --skip | --abort | --quit | --edit-todo DESCRIPTION ----------- @@ -252,6 +252,11 @@ leave out at most one of A and B, in which case it defaults to HEAD. will be reset to where it was when the rebase operation was started. +--quit:: + Abort the rebase operation but HEAD is not reset back to the + original branch. The index and working tree are also left + unchanged as a result. + --keep-empty:: Keep the commits that do not change anything from its parents in the result. |