Monday 1 March 2010

Reminder: svn ignore

A reminder on how to work with svn ignore.

In every folder svn keeps a list of all files/folders to ignore. By using the command "svn propset svn:ignore" you change this list. From my experience the best way is to have a text file "ignore.txt" (where you keep the list of all ignore rules) for every folder. The command "svn propdel svn:ignore ." will remove all rules for this folder and "svn propset svn:ignore -F ignore.txt ." will apply all the rules from the file "ignore.txt" for this folder.

The scenario: you are in a folder "MyFolder" and you want to ignore in this folder all svg files, the whole folder "log" and the whole folder "tmp". Then, you want to remove all ignore rules for this folder.

To add svn:ignore property for folder "MyFolder"
1) Make sure a file/folder to be ignored is not committed to svn repository.
If it is there, remove it from svn repository
2) Create a file "ignore.txt" in the "MyFolder" with the following content:

3) Go to the folder "MyFolder"
4) Run the following command to apply the rules

5) Commit the changes

To remove svn:ignore property for the folder "MyFolder".
1) Go to "MyFolder"
2) Run the following command to remove all the ignore rules.

2) Commit the changes

To do it recursively for all subfolders add "-R" to the command.

2 comments: