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

Re: which files are "known to git"?

From
Junio C Hamano <gitster@pobox.com>
Date
May 21, 2018, 16:08 UTC
Message-ID
<CAPc5daUu3uG0P7OsEenVcwT=BQQKEc0uJZqxmRjqFPLxzEspAw@mail.gmail.com>
In-Reply-To
<CABPp-BH0bw3m5Ubz2+-XyFGwoHD96sAaSen9-SHQSBqMS-9u5w@mail.gmail.com>
On Tue, May 22, 2018 at 12:09 AM, Elijah Newren <newren@gmail.com> wrote:
>
> I had always assumed prior to your email that 'known to Git' meant
> 'tracked' or 'recorded in the index'.
That's been my intention as well ;-)
> From Documentation/git-clean.txt:
>
>     Normally, only files unknown to Git are removed, but if the `-x`
>     option is specified, ignored files are also removed.

The above makes it sound as if "unknown to Git" is synonym to "not marked as ignored via the exclude mechanism", which would incorrectly imply "known to Git" is "marked as ignored via the exclude mechanism".

Which is a sheer nonsense.

I think this is written while forgetting that "known to Git" was already a term with a specific meaning, and used a confusing term unnecessarily loosely.

 "clean" removes files that are not in the index and are not marked as
ignored by default, but with "clean -x", the user can remove all files that
are not in the index, even the ones that are marked as ignored.

In the above version of description, "files that are not in the index" can be replaced with "untracked files" and we can also say "files unknown to Git" (if we want to), but the set of files "clean" operates by default is narrower than "unknown to Git"--it is "unknown to Git and not marked as ignored".

Previous: Robert P. J. DayNext: Robert P. J. Day
Message 7 of 16 in “which files are "known to git"?”
  1. Robert P. J. DayMay 21, 2018
  2. Randall S. BeckerMay 21, 2018
  3. Elijah NewrenMay 21, 2018
  4. Duy NguyenMay 21, 2018
  5. Robert P. J. DayMay 21, 2018
  6. Robert P. J. DayMay 21, 2018
  7. Junio C HamanoMay 21, 2018
  8. Robert P. J. DayMay 21, 2018
  9. Jonathan NiederMay 21, 2018
  10. Robert P. J. DayMay 21, 2018
  11. Jonathan NiederMay 21, 2018
  12. Junio C HamanoMay 22, 2018
  13. Robert P. J. DayMay 23, 2018
  14. Elijah NewrenMay 21, 2018
  15. Robert P. J. DayMay 21, 2018
  16. Stefan BellerMay 21, 2018

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.