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

Re: first para of man gitignore should refer to 'git rm --cached'

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Nov 7, 2010, 19:14 UTC
Message-ID
<20101107191425.GA32302@kytes>
In-Reply-To
<AANLkTim=QCcJDb0600Je-jePvXSXfFMe7FAQ0WMhZKn7@mail.gmail.com>
Hi Sitaram,
Sitaram Chamarty writes:
> It's an FAQ that "why doesn't my gitignore work" when the files in
> question had already been added earlier, usually in error.  The most
> common remedy, I believe, is "git rm --cached" followed by a commit.

Er, no. The documentation says "in order to ignore uncommitted changes in already tracked files". `git rm --cached` removes the file from the index altogether- when the change is committed, Git will actually stop tracking it.

> "update-index" does not seem to be the right answer.
>From the update-index documentation assume-unchanged section, "This

option can be also used as a coarse file-level mechanism to ignore uncommitted changes in tracked files (akin to what .gitignore does for untracked files)". It seems to be right.

-- Ram
Previous: Sitaram ChamartyNext: Sitaram Chamarty
Message 2 of 6 in “first para of man gitignore should refer to 'git rm --cached'”
  1. Sitaram ChamartyNov 7, 2010
  2. Ramkumar RamachandraNov 7, 2010
  3. Sitaram ChamartyNov 8, 2010
  4. Junio C HamanoNov 8, 2010
  5. Sitaram ChamartyNov 9, 2010
  6. Jonathan NiederNov 9, 2010

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.