svn: 在导入过程中忽略属性 [英] svn:ignore property during import
问题描述
如何在导入时递归地应用 svn:ignore glob?
How do I apply an svn:ignore glob recursively while doing an import?
推荐答案
我不知道你说的导入时递归地应用 svn:ignore"是什么意思.
I'm not sure what you mean by "applying svn:ignore recursively while importing".
如果您想从导入中排除一组文件,您可以在导入前在 ~/.subversion/config
中设置 global-ignores 属性.没有命令行选项可以即时执行此操作.
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
虽然费力但我更喜欢后一种方法,因为我不是 svn import 的忠实粉丝(svn del 部分对我来说并不常见,我喜欢回顾提交前的文件列表).
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).
否则,如果您想在导入之前设置层次结构中每个目录的 svn:ignore 属性,您必须使用第二种方法并执行 svn propset(而不是 svn del)在提交之前:
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 .
(您实际上可以执行 svn import 后跟 svn propset,但不能在一次提交中.)
(You may actually do a svn import followed by a svn propset, but not in a single commit.)
这篇关于svn: 在导入过程中忽略属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!