SVN命令删除所有本地丢失的文件 [英] SVN command to delete all locally missing files

查看:161
本文介绍了SVN命令删除所有本地丢失的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在SVN有一个命令,我可以用来删除目录中的所有本地丢失的文件?

或者没有这样做,只列出那些文件缺少(或者,在更一般的情况下,有状态A,D,?等)

解决方案

如果您正在使用TortoiseSVN,只要执行检查修改,按状态列进行排序,选择所有标记为缺少的项点击打开上下文菜单,然后选择删除。最后,承诺将更改发布到存储库。



如果您在Windows上,但更喜欢使用命令行并喜欢使用PowerShell,诀窍:

  svn status | ? {$ _ -match'^!\s +(。*)'} | %{svn rm $ Matches [1]} 

也就是说,丢失文件(在行首以惊叹号表示),捕获相关的文件名,并在该文件名上执行 svn rm



(博客文章 从SVN工作副本中删除所有丢失的文件 在Unix / Linux中也有类似的功能。)


In SVN is there a command I can use to delete all locally missing files in a directory?

Or failing that, some way of listing only those files that are missing (or, in the more general case, have status A, D, ?, etc.)

解决方案

If you are using TortoiseSVN, just do a Check for Modifications, sort by the Status column, select all the entries marked missing, right-click to open the context menu, and select Delete. Finally, commit to publish the changes to the repository.

If you are on Windows, but prefer the command-line and enjoy dabbling in PowerShell, this one-liner will do the trick:

svn status | ? { $_ -match '^!\s+(.*)' } | % { svn rm $Matches[1] }

That is, filter the output to only those lines showing missing files (denoted by an exclamation at the start of the line), capture the associated file name, and perform an svn rm on that file name.

(Blog post Remove all "missing" files from a SVN working copy does something similar for Unix/Linux.)

这篇关于SVN命令删除所有本地丢失的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆