git-rebase --continue eats commits
- From
- Madhu <enometh@meer.net>
- Date
- Aug 31, 2013, 15:26 UTC
- Message-ID
- <20130831.205606.373615550.enometh@meer.net>
- In-Reply-To
- <20100626125924.160F11F212@leonis4.robolove.meer.net>
Don't know if this has been resolved-by-debate here before, But if `git-rebase' finds a hitherto untracked file in the worktree, which it wants to create, it then aborts asking you to remove the file. So if you remove it and ask git to continue with `git-rebase --continue', it then deletes the commit that was being applied from the branch. ---Madhu
(setenv "TDIR" "/dev/shm/foo/")
mkdir -pv $TDIR && cd $TDIR && git-init (cd $TDIR && echo a > a && git add a && git commit -m "a") (cd $TDIR && echo b > b && git add b && git commit -m "b") (cd $TDIR && echo c > c && git add c && git commit -m "c") (cd $TDIR && EDITOR="sed -i -e 's/^pick/edit/'" git rebase -i 'HEAD^^') (cd $TDIR && echo fubar > c) (cd $TDIR && git-rebase --continue)
Rebasing (2/2)
error: The following untracked working tree files would be overwritten by merge:
c
Please move or remove them before you can merge.
Aborting
Could not apply ddd6f51...(cd $TDIR && rm -fv c) (cd $TDIR && git-rebase --continue)
Rebasing (2/2) Successfully rebased and updated refs/heads/master.
(cd $TDIR && git log)
;; commit `c' is gone