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

Re: Ignore on commit

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 5, 2012, 02:44 UTC
Message-ID
<7vwqz5vdrb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAMK1S_jfdW3BepELgPPoUf3qWwmU-o3o8OpMVimdfkERUJkymQ@mail.gmail.com>
Sitaram Chamarty <sitaramc@gmail.com> writes:
Show 5 quoted lines
>> Git ignore doesn't ignore tracked files.
>
> would 'git update-index --assume-unchanged' work in this case?  Didn't
> see it mentioned in any of the replies so far (but I have never used
> it myself)

The assume-unchanged bit is *not* an instruction to tell Git to ignore changes. It is your *promise* that you will not change it, and tells Git that it is free to use the contents from the working tree and the contents in the index interchangeably, taking whichever is more convenient for Git to handle.

So, no, it might appear to work in some cases, but you are playing with an undefined behaviour.

Previous: Sitaram ChamartyNext: Andrew Ardill
Message 8 of 12 in “Ignore on commit”
  1. Marco CraveiroOct 4, 2012
  2. Pascal ObryOct 4, 2012
  3. Marco CraveiroOct 4, 2012
  4. Andrew WongOct 4, 2012
  5. Andrew ArdillOct 5, 2012
  6. demerphqOct 5, 2012
  7. Sitaram ChamartyOct 5, 2012
  8. Junio C HamanoOct 5, 2012
  9. Andrew ArdillOct 5, 2012
  10. Marco CraveiroOct 5, 2012
  11. Philip OakleyOct 5, 2012
  12. Pascal ObryOct 5, 2012

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.