How do I ignore files in Subversion?

2019-01-01 02:33发布

How do I ignore files in Subversion?

Also, how do I find files which are not under version control?

标签: svn command
17条回答
裙下三千臣
2楼-- · 2019-01-01 03:21

Use the command svn status on your working copy to show the status of files, files that are not yet under version control (and not ignored) will have a question mark next to them.

As for ignoring files you need to edit the svn:ignore property, read the chapter Ignoring Unversioned Items in the svnbook at http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.ignore.html. The book also describes more about using svn status.

查看更多
素衣白纱
3楼-- · 2019-01-01 03:23

If you are using TortoiseSVN, right-click on a file and then select TortoiseSVN / Add to ignore list. This will add the file/wildcard to the svn:ignore property.

svn:ignore will be checked when you are checking in files, and matching files will be ignored. I have the following ignore list for a Visual Studio .NET project:

bin obj
*.exe
*.dll
_ReSharper
*.pdb
*.suo

You can find this list in the context menu at TortoiseSVN / Properties.

查看更多
大哥的爱人
4楼-- · 2019-01-01 03:26

When using propedit make sure not have any trailing spaces as that will cause the file to be excluded from the ignore list.

These are inserted automatically if you've use tab-autocomplete on linux to create the file to begin with:

svn propset svn:ignore 'file1
file2' .
查看更多
素衣白纱
5楼-- · 2019-01-01 03:28

As nobody seems to have mentioned it...

svn propedit svn:ignore .

Then edit the contents of the file to specify the patterns to ignore, exit the editor and you're all done.

查看更多
忆尘夕之涩
6楼-- · 2019-01-01 03:29

Also, if you use Tortoise SVN you can do this:

  1. In context menu select "TortoiseSVN", then "Properties"
  2. In appeared window click "New", then "Advanced"
  3. In appeared window opposite to "Property name" select or type "svn:ignore", opposite to "Property value" type desired file name or folder name or file mask (in my case it was "*/target"), click "Apply property recursively"
  4. Ok. Ok.
  5. Commit
查看更多
登录 后发表回答