SVN:如何知道文件被删除的版本? [英] SVN: How to know in which revision a file was deleted?
问题描述
由于我在Windows上使用svn命令行,如何找到修订版本号,在哪个文件被删除?在Windows上,没有像grep和我试图只使用命令行,没有TortoiseSVN的花哨的东西。提前感谢!
Given that I'm using svn command line on Windows, how to find the revision number, in which a file was deleted? On Windows, there are no fancy stuff like grep and I attempting to use command line only, without TortoiseSVN. Thanks in advance!
- 检查已删除文件的历史记录,但它没有回答我的问题。
- 除了svn log -v url> log.out之外,还有什么方法可以使用记事本进行搜索?
- I saw a few posts, like examining history of deleted file but it did not answer my question.
- Is there any way other than svn log -v url > log.out and search with Notepad?
推荐答案
安装Cygwin。
我使用这个:
svn log -v --limit <nr> -v | grep -E '<fileName>|^r' | grep -B 1 <fileName>
其中
fileName - the name of the file or any pattern which matches it
nr - the number of latest revisions in which I want to look for
这将给你所有的操作(添加,删除,删除,修改)有关文件的修订,但与一个简单的调整与 grep
This will give you the revisions for all the actions (add, delete, remove, modify) concerning the file, but with a simple tweak with grep
you can get the revisions only for deletion.
(显然,--limit是可选的,但是你通常有一个概述你有多深的需要搜索,以获得一些性能。)
(Obviously, --limit is optional, however you usually have an overview about how deep you need to search which gains you some performance.)
这篇关于SVN:如何知道文件被删除的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!