Skip to content

Instantly share code, notes, and snippets.

@devthue
Created August 12, 2016 04:18
Show Gist options
  • Save devthue/f2ac49c11330a7074c53e76cbe4bcc96 to your computer and use it in GitHub Desktop.
Save devthue/f2ac49c11330a7074c53e76cbe4bcc96 to your computer and use it in GitHub Desktop.
Git ignore files only locally

Sources: http://stackoverflow.com/questions/1753070/git-ignore-files-only-locally

The .git/info/exclude file has the same format as any .gitignore file. Another option is to set core.excludesFile to the name of a file containing global patterns.

Note, if you already have unstaged changes you must run the following after editing your ignore-patterns:

git update-index --assume-unchanged [<file>...]

Note on $GIT_DIR: This is a notation used all over the git manual simply to indicate the path to the git repository. If the environment variable is set, then it will override the location of whichever repo you're in, which probably isn't what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment