Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to ignore files and directories in SVN

📅 2015-Apr-13 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

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.

For example, to ignore build subdirectory and *.tmp files:

$ svn propset svn:ignore build .
$ svn propset svn:ignore *.tmp .

Note that both these commands set ignore properties for the current directory .

$ svn propset svn:ignore -R *.tmp .
$ 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.

Tried with: Subversion 1.8.8 and Ubuntu 14.04