On Tue, Jan 23, 2024 at 06:40:10AM +0100, Raúl Núñez de Arenas Coronado wrote: > > Do you get different results from that toy repo? If not, then what is > > different about your main repo? Do you perhaps have a stray "*" match > > somewhere in .git/info/exclude, etc? Or are you still providing > > --exclude-from in addition to --exclude-standard? > > The difference lies in how I deal in my computer with ignored files. I > have some files in all my repos which have to be ignored always, so I > have that pattern in my core.excludes file. BUT those files have to be > backed up on my system, just in case my local copy of the repo is lost > for some reason, as they are files I need for development in my > personal machine. > > If I use --exclude-standard, no matter if those files are being > ignored by core.excludes OR .git/info/exclude, they won't appear in > that 'list other files' command output. Ah, OK. I understand your case better now. Then yes, I think --exclude-per-directory is the right thing for you, since it lets you just trigger parts of the exclusion mechanism, and not all. I would say to ignore the deprecation mention in the manpage. ;) (I think this also gives an interesting use case arguing for continuing to support those more-specific exclusion options for ls-files). If you are mostly just using core.excludesFile (and not .git/info/exclude), then I suspect: git -c core.excludesFile /dev/null ls-files -o --exclude-standard would work for you, too (but it sounds like you might also be using .git/info/exclude). -Peff