zet.oliverdavies.uk/source/_zets/28.md
Oliver Davies 13994c6527
Some checks failed
Build and Deploy / build_and_deploy (push) Has been cancelled
Excluding files from Git
2024-11-07 10:19:07 +00:00

775 B

title date tags
Excluding local files from Git 2024-11-07 10:10:19
git

As well as using a shared .gitignore file in a directory, I've had a convention of putting my own files I want to ignore in an .ignored directory and having that in a global excludes file.

This works for most situations, but sometimes files need to be in their expected location and not in a sub-directory.

I also have scripts that check for a file in both places before performing an action.

Git, though, has a built-in way to do this.

Any files added to .git/info/exclude will automatically be excluded by Git and because this is in my .git directory, it won't affect anyone else's version.