examining history of deleted file

前端 未结 17 1832
臣服心动
臣服心动 2020-11-30 17:36

If I delete a file in Subversion, how can I look at it\'s history and contents? If I try to do svn cat or svn log on a nonexistent file, it complai

17条回答
  •  独厮守ぢ
    2020-11-30 18:06

    To get the log of a deleted file, use

    svn log -r lastrevisionthefileexisted
    

    If you want to resurrect the file and keep its version history, use

    svn copy url/of/file@lastrevisionthefileexisted -r lastrevisionthefileexisted path/to/workingcopy/file
    

    If you just want the file content but unversioned (e.g., for a quick inspection), use

    svn cat url/of/file@lastrevisionthefileexisted -r latrevisionthefileexisted > file
    

    In any case, DO NOT use 'svn up' to get a deleted file back!

提交回复
热议问题