git/list[1] front-page[2] threads[3] people[4] search[5] about
 

unexpected file deletion after using git rebase --abort

From
PKPaul A. Kennedy <pakenned@pobox.com>
Date
Jul 3, 2013, 22:44 UTC
Message-ID
<20130703224402.GF9016@localhost.localdomain>
Hello!

I lost a previously untracked file that I added to the index in the middle of a git rebase --interactive session after a git rebase --abort. This was unexpected.

    $ ls forgotten_file
    forgotten_file
    $ git rebase --interactive HEAD~3 
      [change first rebase command from pick to  edit]
    $ git add forgotten_file
    $ git rebase --abort
    $ ls forgotten_file
    ls: cannot access forgotten_file: No such file or directory
    $

I was (of course) able to find the SHA-1 of the dangling blob using 'git fsck', and then retrieve the file using 'git cat-file -p SHA1'

Should this behaviour be considered a bug? That is, should the contents of the working directory (including untracked files) before the git rebase invocation be returned (as if preserved by a git stash --include-untracked)?

If we don't expect this, should we update the documentation for the --abort heading in the git rebase man page to indicate that newly staged content will be lost after a git rebase --abort?

This is for git version 1.8.3
Paul

-- Paul A. Kennedy pakenned@pobox.com

Next: Jonathan Nieder
Message 1 of 6 in “unexpected file deletion after using git rebase --abort”
  1. Paul A. KennedyJul 3, 2013
  2. Jonathan NiederJul 3, 2013
  3. Junio C HamanoJul 3, 2013
  4. Paul A. KennedyJul 4, 2013
  5. Eric SunshineJul 4, 2013
  6. Junio C HamanoJul 5, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.