开发者

How do I clear files marked with a "!" in 'svn status'?

I added files to my SVN but didn't commit them (so that they showed up with an "A" flag in 'svn status'). But then I decided to rename them before committing. I meant to add them and commit, but "svn status" shows the files with the old names marked with a "!" and I can't get rid of this. How do I do it? I even tried "svn delete *" / "svn remove *" in the dire开发者_Python百科ctory but doing an 'svn status' after this still shows the files (which are not on my local hard drive) with the old names, marked with a '!'.


When using wildcards (*) the “remove” command removes all files that match this wildcard – that is, all files in the directory.

But there are none – you’ve already deleted them. So no files get removed as far as SVN is concerned.

You need to remove those files explicitly. If there are many of them, you can use grep and awk to retrieve the relevant files from the status output:

svn st | grep `^!` | awk '{ print $2 }' | xargs svn rm

(untested, use carefully!)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜