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

Re: How to commit removed file?

From
Jakub Narebski <jnareb@gmail.com>
Date
Jan 12, 2007, 10:42 UTC
Message-ID
<eo7omq$1ap$1@sea.gmane.org>
In-Reply-To
<877ivtxbt2.wl%cworth@cworth.org>
Carl Worth wrote:
Show 15 quoted lines
> But now that I tried this case with a recent git (2a3a3c247) for which
> git-rm does working-tree removal without -f, I see that it does
> irretrievably destroy information in this case:
> 
>         $ echo "important stuff" > new-file
>         $ git add new-file
>         $ git rm new-file
> 
> This now deletes new-file from the working tree and there's no copy of
> the data inside git. The old git-rm would just return the file to it's
> "untracked" state in this case.
> 
> I had thought the safety check was going to be that the index state
> matched the HEAD state before git-rm would delete from the working
> tree.

That is certainly bug in new git-rm; it should remove file _only_ if it can be recovered with the same state as it was before git-rm.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Carl WorthNext: Michael S. Tsirkin
Message 11 of 16 in “How to commit removed file?”
  1. Michael S. TsirkinDec 31, 2006
  2. Johannes SchindelinDec 31, 2006
  3. Michael S. TsirkinJan 2, 2007
  4. Johannes SchindelinJan 2, 2007
  5. Junio C HamanoJan 2, 2007
  6. Jakub NarebskiJan 2, 2007
  7. Johannes SchindelinJan 2, 2007
  8. Carl WorthJan 3, 2007
  9. Junio C HamanoJan 6, 2007
  10. Carl WorthJan 12, 2007
  11. Jakub NarebskiJan 12, 2007
  12. Michael S. TsirkinJan 3, 2007
  13. Junio C HamanoJan 3, 2007
  14. Junio C HamanoJan 3, 2007
  15. Michael S. TsirkinJan 4, 2007
  16. Juergen RuehleJan 2, 2007

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.