Sometimes you want to keep some files in your repository, but you don’t want to commit them into your version control system. That’s basically what .gitignore or .hgignore are for. Depending on the team size, this file can become polluted very fast with personal rules, like steve-testing/. It’s much cleaner to define user-specific ignore rules in a second ignore file, which is stored locally:


1. Open {repo}/.git/config and add the following:

excludesfile = {repo}/.gitignore.local

Alternatively, run the following command in your git repository:

$ git config core.excludesfile .gitignore.local

2. Create {repo}/.gitignore.local and add ignore rules the same way as in .gitignore


1. Open {repo}/.hg/hgrc and add this:

ignore.local = {repo}/.hgignore.local

Notice: you need to use an absolute path here.

2. Create {repo}/.hgignore.local and define ignore rules the same way as in .hgignore

The idea of using a .local suffix comes from StackOverflow.


Unfortunately, there is no real alternative for SVN. However, some SVN clients (e.g. TortoiseSVN) provide a workaround using the ignore-on-commit changelist to ignore files locally.

Comment and share

  • page 1 of 1