Rendered at 02:52:46 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
hungryhobbit 7 hours ago [-]
Fun article, but it leaves out my favorite "almost ignore" feature in Git: `.gitattributes`.
This file lets you specify that git should "ignore" the diff from certain files. For instance, Node projects have a `package-lock.json` that is pure noise from a Git standpoint (it's just massive amounts of diff specifying specific versions of libraries, and the real human-readable version is in a separate `package.json` file).
With `.gitattributes` in the root of your project, you can just add a line:
`package-lock.json -diff`
Now, that file will still get staged/committed (which you want) ... but when you `git diff` you won't see the massive amounts of pointless diff in that file.
clates 7 hours ago [-]
> that is pure noise from a Git standpoint
It shouldn't be noise. Don't update it if you're not intentionally trying to, otherwise you're exposing yourself to supply-chain risk for no reason. If you are regularly getting unexpected `package-lock.json` changes then you are doing something wrong.
po1nt 7 hours ago [-]
It's not about unexpected changes. It's about DX in git CLI. You don't want to see massive diffs that are basically unreadable for humans, you just want to see that the file changed.
selcuka 3 hours ago [-]
> you just want to see that the file changed
I check the diff for uv.lock (Python counterpart of package-lock.json) every time I merge a PR. It is important to know which direct or transient dependencies have been updated. We don't blindly bump all dependencies to the latest versions (you shouldn't either).
panzi 36 minutes ago [-]
Python packages aren't quite so insane on transitive dependencies. The diff of package-lock.json can be novel length.
jeromegv 4 hours ago [-]
But it's not always massive, it's a good practice to see what the diff is and ensure there is no weird dependency (aka supply chain attack) showing up in there.
gpvos 5 hours ago [-]
DX = ? Developer experience maybe?
sisve 5 hours ago [-]
Yes
nine_k 4 hours ago [-]
The point is that it should not be massive.
sublinear 2 hours ago [-]
It's a CLI. DX is not the only concern. What about scripts that expect the default git behavior?
You could argue "those scripts are dumb then! outta my way!", but then you shouldn't be using a CLI for whatever it is you're trying to do. If you insist, you can just grep or use the --stat option.
We already know the git CLI has plenty of antifeatures like this. It is up to the devs how they want to proceed, but it doesn't change the fact that hiding things is a footgun.
phinnaeus 4 hours ago [-]
package-lock.json shows all your transitive dependencies, package.json just shows your direct dependencies. It is simply not true that the latter is "the real human-readable version". They serve different purposes and it is dangerous to say you can always ignore the diff in your lock file.
gugagore 1 hours ago [-]
People are jumping on it being an important file to review. You don't want to ignore the diff.
Even if that's true, you definitely do not want to attempt merge two lock files, and using the .gitattributes file to set the merge strategy is a good idea!
rtpg 3 hours ago [-]
as someone who deals with dep upgrades and forensics when trying to figure out a bug I would get _so mad_ if `git diff` didn't show the diffs to lock files.
I get what you're saying about it being line noise but when you need it you need it!
kevincox 11 hours ago [-]
The global/user wide exclude is a feature that should be more widely known. I frequently have people submitting changes to add their IDE/OS/AI/... files to every project's .gitignore. They are almost always pleasantly surprised when I tell them that they can add them to their standard configuration and have them ignored everywhere without bothering every project and without risk of accidentally committing them on a project where they haven't updated the .gitignore yet.
My general rule is that in-repo .gitignore should only be used for repo-specific things (build outputs, dependency folders, ...) and most user tools should be in their own user config.
Anon1096 9 hours ago [-]
You frequently having to tell people about a global configuration gitignore is an obvious consequence of "My general rule is that in-repo .gitignore should only be used for repo-specific things". It wastes less of everyone's time to just gitignore them in every project.
kodablah 7 hours ago [-]
This mindset is how you get lots of IDE/dev-env-specific/platform-specific cruft inside of repos instead of pristine repos. It makes both contribution and maintenance difficult over time. While less of an extreme issue as IDE/dev-env-specific/platform-specific hacks/scripts littering the repo, gitignore entries should be generally justifiable, not ever-growing cruft to be added by each developer specific to their situation.
zarzavat 2 hours ago [-]
I add .DS_Store to every repo despite also having it ignored globally. Efficiency beats pristine. I don't want to have to ever think about or deal with it at all.
inigyou 1 hours ago [-]
but you do think about it when you add it to every repo?
7 hours ago [-]
WCSTombs 4 hours ago [-]
Every time I've requested changes to a pull request because the reviewee didn't know the difference between .gitignore and .config/git/ignore, the reviewee appreciated learning about the feature. The person you're replying to also clearly said their reviewees are pleasantly surprised, so it hardly seems like a waste of time. Also consider that it takes almost no effort on our part to point out this feature, no effort for them to learn it because we tell them directly, and it happens at most once per new contributor or hire.
saagarjha 7 hours ago [-]
I’d really only like my projects to talk about things relevant to the project, instead of having to think about the fact that you might be using Qt Creator.
fluoridation 6 hours ago [-]
Eh. It's a tool, not a document. It should contain things that help development.
mikepurvis 8 hours ago [-]
Fair, but it depends how uniform the culture is around a particular project. Is it haskell and everyone is using emacs? Sure, include those. But trying to chase the requirements of half a dozen different editors is silly.
ffsm8 8 hours ago [-]
That's the thing though, you don't need to do that.
Whoever is using whatever editor can do it, so the effort is distributed to whoever cares to contribute.
There is no meaningful penalty for it to be not up-to-date. There is only a benefit for people who come in when it's already configured, as they don't need to configure anything anymore.
(I say that but I'm using a global ignore too for eg ai configuration like skills as I like to half-ass them before discarding again)
antonvs 7 hours ago [-]
The penalty is a long file full of cruft that's effectively impossible to ever clean up.
wccrawford 11 hours ago [-]
I've always added it to the project's gitignore because I want to make sure nobody else adds those to the project, either, out of ignorance. I'm mainly doing it out of kindness to them, because I am definitely removing them from git again and it's going to cause them some pain.
In the future, I think I might just be less nice about it. I dunno.
xboxnolifes 8 hours ago [-]
This is how I see it. The more contributors you have with a code base, the larger the possibility that one person will mistakenly commit something that could have easily been avoided by just preemptively adding it to the .gitignore.
You cant preempt every file or folder, but its almost no effort to catch the obvious ones.
nomel 9 hours ago [-]
Yeap. To reduce pain, you need to work with reality rather than ideals. If you work with a big group, you either add a few lines into your gitignore, or you write code to check for those very same files in your CI/PR system, because you're tired of reversing commits and rejecting PRs because you're the only one that cares about a few extra files.
xboxnolifes 8 hours ago [-]
This is how I see it. The more contributors you have with a code base, the larger the possibility that at least one person will mistakenly commit something that could have easily been avoided by just preemptively adding it to the project .gitignore.
You cant prompt every file or folder, but its almost no effort to catch the obvious ones.
eyelidlessness 9 hours ago [-]
I’m not sure kindness is the best framing. At least, not in terms of being nice to any particular person who might commit unwanted files by mistake.
It’s one of several tools a project can use to ensure quality, alongside eg linters and formatters. Automating those (in this case by defaulting to the expected outcome) reduces friction on basically every operation anyone might do in a project, in any context.
Through the lens of kindness, it benefits you as well as your team… and ultimately everyone else downstream, since you’re all not wasting time and cognitive load on trivially preventable mistakes.
8cvor6j844qw_d6 9 hours ago [-]
I prefer gitignore since it survives dev container rebuilds.
I can set a creation script or volume to restore/persist configs if I must avoid gitignore. However, that's an extra script or devcontainer mounts config over a gitignore line.
mvanbaak 8 hours ago [-]
In my opinion (which might not be shared by everyone) this is a you problem.
Developers in the team not using decontainers should not have to worry about your environment.
ide/local-env stuff should be ignored in the users git setup, everything that the repo creates (build artifacts, environment files etc) should be in the repo.
arcanemachiner 8 hours ago [-]
Interesting case. For the global ignore file, couldn't you just bind-mount that into the container?
paulddraper 8 hours ago [-]
> However, that's an extra script or devcontainer mounts config over a gitignore line.
paulddraper 8 hours ago [-]
That's an interesting case, where you are crossing operating systems.
---
That said, the easier change is still a one/two line bind mount that trying to exhaustively list ignored directories for every IDE or tool under the sun.
mvdtnz 7 hours ago [-]
Do you not see the conflict between seeing the same incorrect behaviour again and again, and having a firm rule that expressly forbids the easiest fix to that behaviour?
dofm 4 hours ago [-]
I am getting the impression that people both see and enjoy the conflict. :-/
paulddraper 8 hours ago [-]
.DS_Store
hk1337 12 hours ago [-]
~/.config/git/ignore and ~/.config/git/config is the proper place for your global git config and ignore instead of creating a ~/.gitignore_global and changing the config. IMO.
my dotfiles are a lot smaller at the root level taking advantage of the ~/.config/ for a lot more things.
the git exclude isn't used as much because it doesn't get committed to the repository so you'd have to recreate it each time you wanted to use it. that doesn't mean they're bad just why they are not used.
b40d-48b2-979e 12 hours ago [-]
As a bonus, you can (should?) version control your `~/.config` dir to enable future revisions and sharing.
mroche 5 hours ago [-]
You may need to have certain directories be excluded depending on the programs you use. For example, the default Chrome profile location is within ~/.config, which includes cache data that can be multiple gigabytes in size.
b40d-48b2-979e 2 hours ago [-]
Ouch. It doesn't respect `$XDG_CACHE_HOME`?
hk1337 12 hours ago [-]
Absolutely. On that subject, I prefer the Atlassian method for storing dotfiles in git but sometimes I feel like it's Mootools vs jQuery all over again.
coryrc 5 hours ago [-]
Or use ~/.cvsignore for all the other things which use that same file.
judofyr 12 hours ago [-]
Not sure where I picked up this, but I’ve added this to my global Git ignore:
attic
That way you can just create an attic directory in any project where you can keep random stuff that should never be committed. I’ve yet to find a repo which actually has such a directory checker in.
deathanatos 5 hours ago [-]
You can also sort of invert this, but you have to do it on a case by case basis.
Let's say you have a directory like attic; you can put inside a `attic/.gitignore`:
/**
& then that directory (and anything in it) is ignored, including the ignore file itself.
I usually name my version of this directory the single character U+1F4A9, which HN refuses to permit me to put in a comment ;)
weinzierl 10 hours ago [-]
Mine is
aux
and I hide it by putting a .gitignore in it that just contains am asterisk (*), nothing else, that way it ignores itself and anything in it.
3 hours ago [-]
trinix912 8 hours ago [-]
Does Windows still go crazy when making an “aux” or “con” directory or has this been patched?
fluoridation 6 hours ago [-]
It's never going to be patched because it's not considered a bug.
metadat 9 hours ago [-]
Genius idea.
addedGone 9 hours ago [-]
The next Elon musk.
williamjackson 12 hours ago [-]
I do this too! But I call it `.local`
zahlman 11 hours ago [-]
I have a new-repository script that creates a .local directory and puts a .gitignore with just `*` in it.
bflesch 10 hours ago [-]
Doesn't git automatically exclude all files starting with a dot?
groundcontr01 2 hours ago [-]
Hey do you have a GitHub I can look at?
micael_dias 10 hours ago [-]
No
thewisenerd 7 hours ago [-]
mine's `scratch/`
hasn't tripped me up (yet)
dofm 10 hours ago [-]
Re: per-user ignores:
> For example, if you’re on macOS, adding .DS_Store here would be ideal.
As long as every Mac user on your project does. If you have more than one, it may be better off taken out of everyone's hands.
tom_ 3 hours ago [-]
I couldn't say for sure where it came from, but both my Macs (one with Ventura, one with Sequoia) have a ~/.gitignore_global file with an entry for .DS_Store, plus whatever stuff in the global git config makes git ignore stuff mentioned in that file.
This file on my newer Mac is dated 2 days before I ordered it, and I don't remember setting any of this up, so I assume it came like this out of the box. I can't remember the dates for my older Mac, but I assume it's the same thing - and the macOS versions suggest that the default setup might have been like this for a while now.
So, perhaps the days of having to add .DS_Store/ to your .gitignore file are over!
dofm 3 hours ago [-]
Perhaps that is the norm for the command line tools now anyway, yes.
tremon 7 hours ago [-]
That's a very particular way to frame the few vs the many. If a single macOS user works on ten different projects, should all ten projects add that line, or may things be better off taken out of each project's hands and on that single user?
deathanatos 5 hours ago [-]
> If a single macOS user works on ten different projects, should all ten projects add that line,
Not only do people think that, they also think that every pet tool that every pet user might decide to use should also end up cluttering up .gitignores for every project on earth. Worse, these people have created whole templates for this, so they can start a new project with ignores for dozens of tools they don't even use. 9 out of 10 times, this includes a broken ignore for Vim swap files.
I think these people are crazy, and like you suggest, tooling that is particular to you should go in the user's ignore, and tooling particular to the project should go into the repo's ignore.
dofm 5 hours ago [-]
I mean I was just making a quick pragmatic suggestion about a labour-saving change that might be more sensible in practice, given that, rather than being a "pet tool" from a "pet user", it's a default side-effect of a platform that is modestly common in the hands of open source developers (as well as a common accidental side-effect from handling tarballs supplied by Mac users to non-Mac users).
But I wouldn't want to deny anyone an opportunity to regularly rehash a narrow tribal complaint in the comments on a pull request. Yeesh.
7 hours ago [-]
dofm 7 hours ago [-]
I mean sure, if you're this worried about ten bytes and prefer instead to spend time endlessly lecturing new Mac-based submitters about the additional overhead of supporting Mac-based submitters.
saagarjha 7 hours ago [-]
As a Mac user, you should tell them how to do a better job.
3 hours ago [-]
dofm 5 hours ago [-]
This level of tribal antagonism over ten quite commonplace bytes is IMO entirely overcooked, but it is an excellent demonstration of
Me, I am pragmatic. I have set this in my local config and I've added it to my repos to be certain. Because it's ten bytes.
7 hours ago [-]
lmf4lol 7 hours ago [-]
Wow! How did I not know this? I am a professional software dev for 20 years… and only ever used .gitignore !
I just realized that I never even „asked“ myself if there might exist a better way than to clutter .gitignore with all kinds of specific excluded only relevant to me. I just accepted the world as it appeared to me…
And Today, it got s little bit better :-)
supermdguy 1 hours ago [-]
One trick I’ve used is creating a folder and then adding a .gitignore inside it with *. Then nothing in that folder gets tracked, without needing to add anything to the public gitignore. Didn’t know about .git/config though!
bryancoxwell 13 hours ago [-]
I use the ever living hell out of .git/info/exclude. Works great for scripts/Makefiles I only want locally and collaborators wouldn’t care about or be able to use.
RSHEPP 12 hours ago [-]
Interested in examples of the types of scripts others collaborators wouldn't be able to use? Like scripts for PR workflows?
junon 12 hours ago [-]
Usually when I'm working in one part of the codebase and I have sample data or something at a specific path on my local machine and Im testing the same thing over and over again will I make a Makefile or something and info/exclude it to help me keep focused. That's one way I use it.
bryancoxwell 12 hours ago [-]
Yeah this is pretty much it.
digikata 11 hours ago [-]
For quite a while, I've have had a shell fcn that will take all the untracked files listed in a git status, and push them to .git/info/exclude. Generally applied after an add+commit of everything I do want to go generally into the repo.
wpollock 11 hours ago [-]
One point of clarification: with git, "global" means per-user, not "machine-wide. (I never understood why "--global" wasn't better named, maybe "--user".) That's why these pathnames are in a user's home (the "~" means the current user's home directory).
Machine-wide configuration is called "system" in git, and generally lives under "/etc".
dalton_zk 56 minutes ago [-]
Nice, I didn't know the other options besides .gitignore
for files that are already tracked. This can be useful for some local experimentation... it's just a bit annoying to use because it's not really surfaced anywhere by git (kinda). You need to remember that you set it; otherwise other operations like checkouts may be blocked.
Submit that link to Hacker News, and see how far it gets!
jagged-chisel 13 hours ago [-]
Hey, come on now - they added 'check-ignore' which is good complementary advice.
_the_inflator 13 hours ago [-]
You made my day. Everything is said and explained there.
Ok, sometimes a more vivid and visually explanatory style would help, but here still Google is your friend for individual concepts.
One of the best resources there is. git is a hell of a tool. It looks simple but is so beautifully versatile without being complex or not deductive.
b40d-48b2-979e 12 hours ago [-]
git is a hell of a tool. It looks simple but is so beautifully versatile without being complex
without being complex
Uh, what?
rafram 12 hours ago [-]
What part of
Enumerating objects: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 10 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 1.43 KiB | 1.43 MiB/s, done.
Total 8 (delta 7), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (7/7), completed with 7 local objects.
don't you understand?!
dofm 4 hours ago [-]
One of the things I find funniest about git is that it is so exasperating that there is a comedy tool that generates fake git man pages that are worryingly convincing.
And each time someone quotes one there is a chance that an LLM will be trained on it.
onraglanroad 11 hours ago [-]
Well, since I know what a delta is, and I know what an object is, I understand all of it.
rafram 10 hours ago [-]
Congratulations!
onraglanroad 6 hours ago [-]
Learn what those two things are and you can join me in celebration!
y2244 12 hours ago [-]
"Google is your friend for individual concepts."
Asking aLlm is the new google
jeremyscanvic 12 hours ago [-]
I knew about .git/info/exclude and ~/.config/git/ignore but not about git-check-ignore(1). Neat!
yieldcrv 42 minutes ago [-]
but dont forget dockerfile ignore if you use docker
antisol 2 hours ago [-]
Point of pedantry:
> The ignore file lives in your machine’s home directory in ~/.config/git/ignore. Whatever filenames are added to this file are ignored globally at a machine-level.
The wording here is slightly wrong: ~/.config/git/ignore will ignore files per-user on the machine, not "at a machine level". And it's not "your machine's home directory", it's your user's home directory on that machine. Any other users on the same machine will not see this. Git calls this "global", as in "global for the user".
Git config does also have a --system option which modifies the system-level config file, /etc/gitignore. You could probably ignore stuff at the system/machine level (hint: you don't want to), with this. I'd do something like:
Note however that user config will override this, so any user who has a core.excludesFile setting will not also look at your system level excludes file. Which is a pretty big caveat.
hmokiguess 8 hours ago [-]
git is so incredible, it never ceases to amaze me, what a timeless piece of software
bitvvip 12 hours ago [-]
I still like using gitignore very much
globular-toast 11 hours ago [-]
Magit has good support for these other methods. You press <i> and then select if you want the ignore to be shared (.gitignore) or private (.git/info/exclude).
juxtapose 3 hours ago [-]
Magit introduced me to them in the first place. :-D
tonymet 10 hours ago [-]
these are great for ignoring files by name, but you often want to ignore binary files or other files by type.
Set a global hooks dir, and then block binary files in pre-commit by using file or checking the git index
allows for remote specific configs, overriding say email or other required options depending on where you send contributions - without having to have per repo config
works for dir too
[includeIf "gitdir:/home/user/src/work1/"]
Git is REAL bitch about exact syntax here; the first snippet won't work with just :*, it needs :/* ; the second won't work without trailing slash
arikrahman 4 hours ago [-]
[dead]
codymisc 5 hours ago [-]
[flagged]
uptown 11 hours ago [-]
Not really news. I worked with dozens of developers who have managed to ignore files in Git.
This file lets you specify that git should "ignore" the diff from certain files. For instance, Node projects have a `package-lock.json` that is pure noise from a Git standpoint (it's just massive amounts of diff specifying specific versions of libraries, and the real human-readable version is in a separate `package.json` file).
With `.gitattributes` in the root of your project, you can just add a line:
`package-lock.json -diff`
Now, that file will still get staged/committed (which you want) ... but when you `git diff` you won't see the massive amounts of pointless diff in that file.
It shouldn't be noise. Don't update it if you're not intentionally trying to, otherwise you're exposing yourself to supply-chain risk for no reason. If you are regularly getting unexpected `package-lock.json` changes then you are doing something wrong.
I check the diff for uv.lock (Python counterpart of package-lock.json) every time I merge a PR. It is important to know which direct or transient dependencies have been updated. We don't blindly bump all dependencies to the latest versions (you shouldn't either).
You could argue "those scripts are dumb then! outta my way!", but then you shouldn't be using a CLI for whatever it is you're trying to do. If you insist, you can just grep or use the --stat option.
We already know the git CLI has plenty of antifeatures like this. It is up to the devs how they want to proceed, but it doesn't change the fact that hiding things is a footgun.
Even if that's true, you definitely do not want to attempt merge two lock files, and using the .gitattributes file to set the merge strategy is a good idea!
I get what you're saying about it being line noise but when you need it you need it!
My general rule is that in-repo .gitignore should only be used for repo-specific things (build outputs, dependency folders, ...) and most user tools should be in their own user config.
There is no meaningful penalty for it to be not up-to-date. There is only a benefit for people who come in when it's already configured, as they don't need to configure anything anymore.
(I say that but I'm using a global ignore too for eg ai configuration like skills as I like to half-ass them before discarding again)
In the future, I think I might just be less nice about it. I dunno.
You cant preempt every file or folder, but its almost no effort to catch the obvious ones.
You cant prompt every file or folder, but its almost no effort to catch the obvious ones.
It’s one of several tools a project can use to ensure quality, alongside eg linters and formatters. Automating those (in this case by defaulting to the expected outcome) reduces friction on basically every operation anyone might do in a project, in any context.
Through the lens of kindness, it benefits you as well as your team… and ultimately everyone else downstream, since you’re all not wasting time and cognitive load on trivially preventable mistakes.
I can set a creation script or volume to restore/persist configs if I must avoid gitignore. However, that's an extra script or devcontainer mounts config over a gitignore line.
---
That said, the easier change is still a one/two line bind mount that trying to exhaustively list ignored directories for every IDE or tool under the sun.
my dotfiles are a lot smaller at the root level taking advantage of the ~/.config/ for a lot more things.
the git exclude isn't used as much because it doesn't get committed to the repository so you'd have to recreate it each time you wanted to use it. that doesn't mean they're bad just why they are not used.
Let's say you have a directory like attic; you can put inside a `attic/.gitignore`:
& then that directory (and anything in it) is ignored, including the ignore file itself.I usually name my version of this directory the single character U+1F4A9, which HN refuses to permit me to put in a comment ;)
hasn't tripped me up (yet)
> For example, if you’re on macOS, adding .DS_Store here would be ideal.
As long as every Mac user on your project does. If you have more than one, it may be better off taken out of everyone's hands.
This file on my newer Mac is dated 2 days before I ordered it, and I don't remember setting any of this up, so I assume it came like this out of the box. I can't remember the dates for my older Mac, but I assume it's the same thing - and the macOS versions suggest that the default setup might have been like this for a while now.
So, perhaps the days of having to add .DS_Store/ to your .gitignore file are over!
Not only do people think that, they also think that every pet tool that every pet user might decide to use should also end up cluttering up .gitignores for every project on earth. Worse, these people have created whole templates for this, so they can start a new project with ignores for dozens of tools they don't even use. 9 out of 10 times, this includes a broken ignore for Vim swap files.
I think these people are crazy, and like you suggest, tooling that is particular to you should go in the user's ignore, and tooling particular to the project should go into the repo's ignore.
But I wouldn't want to deny anyone an opportunity to regularly rehash a narrow tribal complaint in the comments on a pull request. Yeesh.
https://en.wikipedia.org/wiki/Narcissism_of_small_difference...
Me, I am pragmatic. I have set this in my local config and I've added it to my repos to be certain. Because it's ten bytes.
I just realized that I never even „asked“ myself if there might exist a better way than to clutter .gitignore with all kinds of specific excluded only relevant to me. I just accepted the world as it appeared to me…
And Today, it got s little bit better :-)
Machine-wide configuration is called "system" in git, and generally lives under "/etc".
https://laszlo.nu/blog/project-level-git-config.html
Ok, sometimes a more vivid and visually explanatory style would help, but here still Google is your friend for individual concepts.
One of the best resources there is. git is a hell of a tool. It looks simple but is so beautifully versatile without being complex or not deductive.
https://git-man-page-generator.lokaltog.net/
And each time someone quotes one there is a chance that an LLM will be trained on it.
Asking aLlm is the new google
Git config does also have a --system option which modifies the system-level config file, /etc/gitignore. You could probably ignore stuff at the system/machine level (hint: you don't want to), with this. I'd do something like:
Note however that user config will override this, so any user who has a core.excludesFile setting will not also look at your system level excludes file. Which is a pretty big caveat.Set a global hooks dir, and then block binary files in pre-commit by using file or checking the git index
Or block large changes, because binary mods are often larger than a real diff.works for dir too
Git is REAL bitch about exact syntax here; the first snippet won't work with just :*, it needs :/* ; the second won't work without trailing slash