如何从命令行中的svn中删除名称中带有@的文件? [英] How to remove a file with @ in it's name from svn in command line?
问题描述
使用新的 iPhone 2x 文件时,我偶然发现了这个问题......
With the new iPhone 2x files i've stumbled uppon this problem...
推荐答案
需要在最后加一个@"符号才能让 SVN 处理文件.
You need to add a "@" sign in the end to get SVN to process the file.
例如,如果您有一个名为 foo@2x.png 的文件要添加到 SVN,您可以输入:
For example, if you had a file called foo@2x.png which you want to add to SVN, you would type:
svn add foo@2x.png@
如果您有很多文件名中带有@"符号的文件,您想批量处理(即使用 * 通配符),您可以在 OS X 终端中执行以下操作:
If you have lots of files with the "@" symbol in their name that you want to process in a batch (i.e. use * wildcard), you can do something like this in OS X Terminal:
find . -name "*@*" | xargs -I % svn add %@
上述命令将使用 find 实用程序列出文件名中带有 @ 的每个文件,然后使用 XARGS 将每个文件路径通过管道传送到 SVN.
The above command will use the find utility to list out each file with @ in its filename and then pipe each filepath to SVN using XARGS.
对于每个文件路径,XARGS都会执行提供的命令 svn add %@
,除了-I %
告诉 XARGS 将 提供的命令 中出现的每个%"替换为管道文件路径.XARGS 有效地在文件名末尾附加了特殊的@".
For each filepath, XARGS will execute the provided command svn add %@
, except that -I %
tells XARGS to replace each occurrence of "%" in the provided command, with the filepath piped. XARGS effectively appends the special "@" at the end of the filename.
比如替换%"字符后,XARGS会执行svn add path/to/your/file@2x.png@
;SVN 会接受这个(大概是因为 SVN 寻找 last 出现的@"并将其视为修订说明符)
For example, after replacing the "%" character, XARGS will execute svn add path/to/your/file@2x.png@
; SVN will accept this (presumably because SVN looks for the last occurrence of "@" and treats this as a revision specifier)
希望这会有所帮助 - 我不得不费点脑筋来添加 gazzilion @2x.png 文件,这些文件是我的应用升级到 iOS4.0 所需的
Hope this helps - I had to whack my head for a bit to add the gazzilion @2x.png files that were needed for my app to be upgraded for iOS4.0
这篇关于如何从命令行中的svn中删除名称中带有@的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!