zoukankan      html  css  js  c++  java
  • 用于svn添加当前目录下所有未追踪的文件,和删除所有手动删除的文件的脚本

    由于要经常用到类似与 git 中的 git add --all 这种操作,但是发现svn中并不支持类似的操作。

    虽然可以使用 wildcard 进行匹配,但是 wildcard是在shell中进行匹配的,所以并不能递归地匹配到某个目录下所有的文件。

    于是,参考网上的一些讨论,写了以下两个脚本:

    用户添加本目录下所有文件的脚本:

    #!/bin/bash
    # add all untracked files under current directory
    svn status | grep '^?' | sed 's/? *//' | xargs -r -d ' ' svn add

    用于从仓库删除本目录下手动删除的所有文件的脚本:

    #!/bin/bash
    # delete all deleted files under current directory from svn repository
    svn status | grep '^!' | sed 's/! *//' | xargs -r -d ' ' svn rm

    可以将以上两个脚本分别放倒两个文件中:例如 svnadd svnrm

    然后就可以伪装成命令使用了

  • 相关阅读:
    Codeforces
    Codeforces
    SCUT
    模板
    SCUT
    SCUT
    模板
    SCUT
    UVA 437 "The Tower of Babylon" (DAG上的动态规划)
    UVA 1025 "A Spy in the Metro " (DAG上的动态规划?? or 背包问题??)
  • 原文地址:https://www.cnblogs.com/vanwoos/p/5977455.html
Copyright © 2011-2022 走看看