From: Jan Hudec <bulb@ucw.cz>
To: git <git@vger.kernel.org>
Subject: Re: git rm --cached
Date: Sun, 11 Nov 2007 15:05:18 +0100 [thread overview]
Message-ID: <20071111140518.GA3847@efreet.light.src> (raw)
In-Reply-To: <20071102021711.GA28703@fawkes.hq.digizenstudio.com>
[-- Attachment #1: Type: text/plain, Size: 679 bytes --]
On Thu, Nov 01, 2007 at 22:17:11 -0400, Jing Xue wrote:
> In the following scenario, why do I have to run 'git reset' following
> 'git rm --cached 1.txt' to revert to exactly where I was before 'git add
> 1.txt'? Shouldn't 'git rm --cached' have done that already?
The message in git-commit suggesting to use 'git rm --cached' to unstage is
just plain wrong. It really should mention 'git reset'.
git rm, as the name suggests, *removes* the file.
git reset, as the name suggests, reverts it to the state it was before (but,
somewhat confusingly, with path limit only resets the index, so no --cached
option there).
--
Jan 'Bulb' Hudec <bulb@ucw.cz>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-11-11 14:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-02 2:17 git rm --cached Jing Xue
2007-11-02 16:13 ` Remi Vanicat
2007-11-02 21:41 ` Jing Xue
2007-11-03 9:39 ` Remi Vanicat
2007-11-04 17:04 ` Matthieu Moy
2007-11-11 14:05 ` Jan Hudec [this message]
2007-11-12 0:38 ` [PATCH] replace reference to git-rm with git-reset in git-commit doc Jing Xue
2007-11-12 2:27 ` Junio C Hamano
2007-11-12 4:43 ` [PATCH] RESUBMIT: " Jing Xue
2007-11-14 8:56 ` 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=20071111140518.GA3847@efreet.light.src \
--to=bulb@ucw.cz \
--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).