git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Santi Béjar" <sbejar@gmail.com>
To: "Git Mailing List" <git@vger.kernel.org>
Subject: Removing a newly added file
Date: Mon, 26 Mar 2007 16:59:57 +0200	[thread overview]
Message-ID: <8aa486160703260759v438d445ev82161600d8e8bf02@mail.gmail.com> (raw)

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

             reply	other threads:[~2007-03-26 15:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-26 14:59 Santi Béjar [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8aa486160703260759v438d445ev82161600d8e8bf02@mail.gmail.com \
    --to=sbejar@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).