It is easy to ignore files and directories in Git or Mercurial. Ignore files can be maintained at both the user and repository levels. Git or Mercurial automatically ignore the files and directories that match the patterns listed in these ignore files.
Being a version control system from an older era, Subversion does not have this simple method of ignore.
- In SVN, ignoring a file or directory is a property that can be set at a specific directory in a repository.
For example, to ignore
build subdirectory and
$ svn propset svn:ignore build . $ svn propset svn:ignore *.tmp .
Note that both these commands set ignore properties for the current directory
- To set an ignore property recursively to all subdirectories in a repository, go to the repository root directory and issue this:
$ svn propset svn:ignore -R *.tmp .
- Thankfully, you can use an ignore file containing ignore patterns, one per line, as input:
$ svn propset svn:ignore -R -F ~/.svnignore .
Note the difference with Git or Mercurial. You have to manually set this ignore property on every directory. The ignore file we created is for our convenience. If you create a new subdirectory anywhere in this repository, the property needs to be applied again on it.
- Remember to commit after setting the ignore property.
Tried with: Subversion 1.8.8 and Ubuntu 14.04