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

Re: gitignore vs. exclude vs assume-unchanged?

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 16, 2014, 17:51 UTC
Message-ID
<xmqqy4z5go1y.fsf@gitster.dls.corp.google.com>
In-Reply-To
<b3f480af1c362c615ad9ce85296e2be2@bellandwhistle.net>
alex@bellandwhistle.net writes:
> Any clarification on the differences much appreciated:
>
> http://stackoverflow.com/questions/23097368/git-ignore-vs-exclude-vs-assume-unchanged/23097509
Please don't force people to refer to external site.

The .gitignore and .git/info/exclude are the two UIs to invoke the same mechanism. In-tree .gitignore are to be shared among project members (i.e. everybody working on the project should consider the paths that match the ignore pattern in there as cruft). On the other hand, .git/info/exclude is meant for personal ignore patterns (i.e. you, while working on the project, consider them as cruft).

Assume-unchanged should not be abused for an ignore mechanism. It is "I know my filesystem operations are slow. I'll promise Git that I won't change these paths by making them with that bit---that way, Git does not have to check if I changed things in there every time I ask for 'git status' output". It does not mean anything other than that. Especially, it is *not* a promise by Git that Git will always consider these paths are unmodified---if Git can determine a path that is marked as assume-unchanged has changed without incurring extra lstat(2) cost, it reserves the right to report that the path *has been* modified (as a result, "git commit -a" is free to commit that change).

Previous: alex@bellandwhistle.netNext: alex@bellandwhistle.net
Message 2 of 10 in “gitignore vs. exclude vs assume-unchanged?”
  1. alex@bellandwhistle.netApr 16, 2014
  2. Junio C HamanoApr 16, 2014
  3. alex@bellandwhistle.netApr 16, 2014
  4. Jonathan NiederApr 16, 2014
  5. alex@bellandwhistle.netApr 18, 2014
  6. Andrew ArdillApr 22, 2014
  7. Junio C HamanoApr 22, 2014
  8. alex@bellandwhistle.netApr 25, 2014
  9. luc.linux@mailoo.orgApr 26, 2014
  10. ZéApr 26, 2014

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.