svn:ignore property during import

坚强是说给别人听的谎言 提交于 2019-12-08 15:29:35

问题


How do I apply an svn:ignore glob recursively while doing an import?


回答1:


I'm not sure what you mean by "applying svn:ignore recursively while importing".

If you want to exclude a set of files from being imported you can set the global-ignores property in ~/.subversion/config before importing. There's no command line option to do that on-the-fly.

Alternatively you may add the directory and delete the unwanted files before committing:

$ svn co --non-recursive <repository_url> repo_root
$ cp -R <project_to_import> repo_root
$ cd repo_root
$ svn add *
$ find . -regex ".*\.\(bak\|obj\)" | xargs svn --force del
$ svn ci

Although laborious I prefer the latter approach because I'm not a big fan of svn import (the svn del part is not common for me and I like to review the file list before committing).

Otherwise, if what you want is to set the svn:ignore property of every directory in the hierarchy before importing you must use the second method and do a svn propset (instead of svn del) before comitting:

$ svn propset -R -F ignore.txt svn:ignore .

(You may actually do a svn import followed by a svn propset, but not in a single commit.)




回答2:


You can't do that with a regular import; you need an in-place import.



来源:https://stackoverflow.com/questions/736856/svnignore-property-during-import

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!