简体   繁体   English

svn:忽略复杂的目录结构

[英]svn:ignore for a complicated directory structure

i have a directory structure like this: 我有这样的目录结构:

home/ 家/

- application/

- images/

- temporary/

     scripts/

     js/

     cache/

     uploads/

Now i want to keep my temporary directory and all the sub-directories like (scripts, js, cache, upload....) in the svn, but i want to svn:ignore all the content which is inside directories, so that every time i execute svn status -u, data from temporary directory won't list. 现在我想将我的临时目录和所有子目录(例如,脚本,js,缓存,上载...)保留在svn中,但是我想svn:忽略目录中的所有内容,以便每个当我执行svn status -u时,临时目录中的数据将不会列出。

I am using linux. 我正在使用linux。 and using following commands: 并使用以下命令:

svn propset svn:ignore "*" . svn propset svn:ignore“ *”。

and then commit -m 'text' 然后提交-m'text'

i can see temporary directory listed when executing this command: 执行此命令时,我可以看到列出的临时目录:

svn propget svn:ignore svn propget svn:ignore

SVN Book must be your best friend for a long time. SVN Book 必须长期以来是您最好的朋友

Re-read carefully description of svn:ignore property in "Chapter 3. Advanced Topics" - "Properties" - Subversion's Reserved Properties topic and detect 3 your mistakes 重新阅读“第3章,高级主题”-“属性” -Subversion的“保留属性”主题中的svn:ignore属性的详细说明,并发现3个错误

If you still will not be able to do it 如果您仍然无法做到这一点

svn:ignore

If present on a directory , the value is a list of unversioned file patterns to be ignored by svn status and other subcommands. 如果存在于目录中 ,则该值是svn status和其他子命令将忽略的未版本化文件模式的列表。

means: 手段:

  • if you want to ignore files in <somedir> then svn:ignore must be defined for <somedir> , for every <somedir> , not just once somewhere 如果要忽略<somedir>文件,则必须<somedir> 定义 svn:ignore,对于每个<somedir> ,而不仅仅是某个位置
  • files, which you want to see ignored, must not be versioned. 您希望忽略的文件不能进行版本控制。 Ingone will work only with externals files, not with files already in repo Ingone仅适用于外部文件, 不适用于已在回购中的文件

Thus: 从而:

  1. scripts/* + js/* + cache/* + uploads/* files must show status ? 脚本/ * + js / * +缓存/ * +上传/ *文件必须显示状态? , but parent directories - exist already in repo ,但父目录-已存在于仓库中
  2. svn propset svn:ignore "*" . must be executed not in outer space blindly but after cd to every parent dir, 4 times 必须不是盲目地在外层空间执行,而是在cd到每个父目录之后执行4次
  3. Executed in unknown dir ( /home ???) wrong svn propset svn:ignore "*" . 在未知目录( /home ???)中执行了错误的svn propset svn:ignore "*" . must be found and undo'ed ( svn pd ... ) 必须找到并撤消( svn pd ...

If you are using svn version >= 1.7 you may consider the set-depth option, so that files will remain on the svn but you will not have them and not track them in your working copy. 如果您使用的是svn版本> = 1.7,则可以考虑使用set-depth选项,这样文件将保留在svn上,但不会包含它们,也不会在工作副本中跟踪它们。

svn update --set-depth='immediates' temporary svn update --set-depth ='immediates'临时

to revert use --set-depth='infinity' 恢复使用--set-depth ='infinity'

and to check your working copies against svn server use both svn list and svn info commands. 并根据svn服务器检查您的工作副本,请同时使用svn listsvn info命令。

Is that what you want ? 那是你要的吗 ?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM