Skip to content
  • Duy Nguyen's avatar
    rebase: add --quit to cleanup rebase, leave everything else untouched · 9512177b
    Duy Nguyen authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    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: default avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    9512177b