27 points faithraven 2 hours ago 14 comments
DamonHD 2 hours ago | parent
Ah, very good!
festive-minsky 2 hours ago | parent
Thanks I had no idea about these either!
biglyburrito 53 minutes ago | parent
I'd never heard of .git/info/exclude, core.excludesFile, or ~/.config/git/ignore before. Thanks for posting this!
6LLvveMx2koXfwn 37 minutes ago | parent
This is great, and nicely written up in the context of agentic repos etc, but presumably no-one reads the official docs, right: https://git-scm.com/docs/gitignore where the multiple ways of ignoring files are clearly stated?
alexpotato 31 minutes ago | parent
There is a tweet doing numbers on Twitter right now which is effectively:
"Do the reading b/c you would be amazed how many people don't do the reading"
bigfishrunning 27 minutes ago | parent
So many people treat git commands like magic words, and then are terrified when they mess up their repo (example in this xkcd... https://xkcd.com/1597/)
Reading documentation is a superpower
faithraven 15 minutes ago | parent
I'd wager a small sum that git is the tool most of us learned by accident, some of them fortunate, some less so. Thankfully, this one was the former.
faithraven 17 minutes ago | parent
Until Claude suggested .git/info/exclude, it never crossed my mind to question how ignoring worked. A search would have answered it in seconds, but you have to think to ask first. I didn't, and I suspect most people don't either. Especially with git, which nearly everyone learns by doing; very few of us ever sit down and learn it properly.
That's why I wrote it up: so a few more people can learn this the way we learn everything else in git, by accident.
Now that you mention it, I should add a link to those docs in the article. Thanks!
onaclov2000 1 minute ago | parent
This is true, using AI to help discover better ways of working with stuff is pretty epic, reading docs are about as exciting as writing docs, esp when you are trying to get something done.
psygn89 19 minutes ago | parent
This is great... one thing I wish is to be able to exclude are lines, for instance some lines in my config that only benefits the work I do. Some configs don't allow extending and that's where this would come in handy. Anyone have any tricks for that?
jo-m 12 minutes ago | parent
You can from the checked in config file include a local file which is not checked in (only if it exists).
For example, with direnv, the `.envrc` in my projects usually has
source_env_if_exists .envrc.local
And the repo also ships with a `.envrc.local.example` file.faithraven 9 minutes ago | parent
You might be surprised, it's sort of possible. Ask your favourite AI agent about git clean filters, and .git/info/attributes, the per-clone sibling of .git/info/exclude. The docs are here: https://git-scm.com/docs/gitattributes#_filter