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

Re: [PATCH] replace reference to git-rm with git-reset in git-commit doc

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 12, 2007, 02:27 UTC
Message-ID
<7vsl3c8afm.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20071112003845.GA7595@fawkes>
Jing Xue <jingxue@digizenstudio.com> writes:
Show 19 quoted lines
> On Sun, Nov 11, 2007 at 03:05:18PM +0100, Jan Hudec wrote:
>> 
>> The message in git-commit suggesting to use 'git rm --cached' to unstage is
>> just plain wrong. It really should mention 'git reset'.
>
> Hopefully this makes it clearer. I have also updated the faq in wiki to
> clarify.
>
> diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
> index e54fb12..7c63dd8 100644
> --- a/Documentation/git-commit.txt
> +++ b/Documentation/git-commit.txt
> @@ -154,12 +154,12 @@ EXAMPLES
>  --------
>  When recording your own work, the contents of modified files in
>  your working tree are temporarily stored to a staging area
> +called the "index" with gitlink:git-add[1].  File changes
> +previously staged can be removed with `git-reset
> +HEAD -- <file>`.

I think "changes ... can be removed" risks to give a confused mental model that somehow git tracks changes. "A file can be reverted back to that of the last commit with ..." would be less risky.

Previous: Jing XueNext: Jing Xue
Message 8 of 10 in “git rm --cached”
  1. Jing XueNov 2, 2007
  2. Remi VanicatNov 2, 2007
  3. Jing XueNov 2, 2007
  4. Remi VanicatNov 3, 2007
  5. Matthieu MoyNov 4, 2007
  6. Jan HudecNov 11, 2007
  7. replace reference to git-rm with git-reset in git-commit docJing Xue, Nov 12, 2007
  8. Junio C HamanoNov 12, 2007
  9. RESUBMIT: replace reference to git-rm with git-reset in git-commit docJing Xue, Nov 12, 2007
  10. Junio C HamanoNov 14, 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.