Ignoring a file in a given git
repository… just for you
Sometimes I want to be able to have a file hanging around in a local version of a git
repository that I’ve checked out. For example, I often create a shell.nix
that specifies build dependencies without installing them system-wide. Here’s how I add a shell.nix
to the root of a repository while also instructing git
to ignore it – and without adding or making a modification to `.gitignore:
$ cat >> .git/info/exclude
This feature and similar ones related to ignoring files can be found at git-scm.com/docs/gitignore.