Ignoring git changes locally
It is well known that in a git repository we can use a .gitignore file to skip tracking files we do not want to push to the remote repository. If a file matches a .gitignore pattern, it will not appear in git status when you want to add its changes to a commit.
They are typically used to ignore directories where dependencies are installed (e.g. the virtualenv for Python projects, usually found in .venv), temporary files generated by the interpreter or compiler, IDE-specific files, and so on.
They are so common that GitHub offers gitignore templates curated for different programming languages, and tools such as uv init generate a basic .gitignore as part of the boilerplate.
A .gitignore is part of the project (it is committed), and it is important to keep it in the repository so that every collaborator shares the same configuration.
But what if we want to ignore files only locally?