Revert svn files by file pattern

前端 未结 1 1694
渐次进展
渐次进展 2021-01-27 13:44

I\'m trying to find a command (can be bash command) to revert a group of svn files.

Let\'s say I have some changes in my check-out and I run svn st and get

相关标签:
1条回答
  • 2021-01-27 14:09

    The way I finally did it is by creating this command:

    svn st | grep SomeFolderA | awk {'print $2'} | xargs svn revert
    

    Explanation:

    1. svn st - Finds all the modified file
    2. grep SomeFolderA - Filters the svn output to only show lines that have SomeFolderA
    3. awk {'print $2'} - removes the M at the beginning of each output line
    4. xargs svn revert - The xargs command uses the output from previous command and passes it, as is, to the svn revert command
    0 讨论(0)
提交回复
热议问题