SVN: How to know in which revision a file was deleted?

前端 未结 3 1306
死守一世寂寞
死守一世寂寞 2021-02-03 23:54

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

3条回答
  •  轮回少年
    2021-02-04 00:25

    Install Cygwin.

    I use this:

    svn log -v --limit  -v | grep -E '|^r' | grep -B 1 
    

    where

    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
    

    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.

    (Obviously, --limit is optional, however you usually have an overview about how deep you need to search which gains you some performance.)

提交回复
热议问题