git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Removing a newly added file
@ 2007-03-26 14:59 Santi Béjar
  2007-03-26 18:55 ` [PATCH] git-rm: don't remove newly added file without -f Jeff King
  0 siblings, 1 reply; 7+ messages in thread
From: Santi Béjar @ 2007-03-26 14:59 UTC (permalink / raw)
  To: Git Mailing List

Hi *,

  when you try removing a newly added file it success and removes the
file from the working directory. So if you do:

$ echo "newly added file" > new
$ git add new
$ git rm new

the file "new" is lost, it is not in the index, neither in HEAD. At
this moment the only way to recover the file new is searching for
unreachable objects. (Am I missing something?)

  I think that the "git rm new" should remove "new" from the index or
should fail, maybe with:

$ git rm new
error: 'new' is not in HEAD (hint: try --cached)

  Santi

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-03-26 22:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-26 14:59 Removing a newly added file Santi Béjar
2007-03-26 18:55 ` [PATCH] git-rm: don't remove newly added file without -f Jeff King
2007-03-26 21:11   ` Junio C Hamano
2007-03-26 21:17     ` Johannes Schindelin
2007-03-26 21:33       ` Junio C Hamano
2007-03-26 22:22         ` Jeff King
2007-03-26 22:36           ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).