Re: which files are "known to git"?
From: Robert P. J. Day <hidden>
Date: 2018-05-21 15:55:31
On Mon, 21 May 2018, Elijah Newren wrote:
Hi Robert,
I had always assumed prior to your email that 'known to Git' meant 'tracked' or 'recorded in the index'. However, a quick `git grep -i known.to.git` shows that we're actually not consistent by what we mean with this phrase. A little test setup: $ echo ignoreme >>.gitignore $ git add .gitignore $ git commit -m ignoreme $ touch ignoreme $ git ls-files -o ignoreme $ git ls-files -o --exclude-standard $quoted
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. This implies that ignored files are not 'unknown to Git', or fixing the double negative, that ignored files are 'known to Git': $ git clean -n $ git clean -nx Would remove ignoreme $
uh oh ... i'm just now remembering a discussion once upon a time where this wasn't simply a double negative. IIRC (and someone else help me out here), "known to git" also meant known *not* to be tracked or something like that (as in, ignored files). anyone remember that conversation? rday