Last Updated: February 25, 2016
·
473
· scichelli

Git ignore a file without cluttering the shared .gitignore

I'd made myself a helper script that, being specific to my workstation and my workflow, I didn't want to commit to the repo. Nor did I want to add that little oddball to the .gitignore file that's part of the repo. But it kept showing up as an untracked file that I had to remember not to commit.

Git offers a local-only list of files to exclude. In the folder containing your git repository, open the .git folder, then the info folder, and edit the exclude file. Add your item to be ignored, using the same syntax that .gitignore uses.