zoukankan      html  css  js  c++  java
  • How to use “svn add” recursively in Linux shell?

    This command will add any un-versioned files listed in svn st command output to subversion.

    Note that any filenames containing whitespace in the svn stat output will not be added. Further, odd behavior might occur if any filenames contain '?'s.

    svn st | grep ? | tr -s ' ' | cut -d ' ' -f 2 | xargs svn add
    

    or if you are good at awk:

    svn st | grep ? | awk '{print $2}' | xargs svn add
    

    Explanation:

    Step 1: svn st command

    [user@xxx rails]$svn st
    ?       app/controllers/application.rb
    M       app/views/layouts/application.html.erb
    ?       config/database.yml
    

    Step 2: We grep the un-versioned file with grep command:

    [user@xxx rails]$svn st | grep ?
    ?       app/controllers/application.rb
    ?       config/database.yml
    

    Step 3: Then remove the squeeze the space between ? and file path by using tr command:

    [user@xxx rails]$svn st | grep ? | tr -s ' '
    ? app/controllers/application.rb
    ? config/database.yml
    </pre>
    

    Step 4: Then select second column from the output by using cut command:

    [user@xxx rails]$svn st | grep ? | tr -s ' ' | cut -d ' ' -f 2
    app/controllers/application.rb
    config/database.yml
    

    Step 5: Finally, passing these file paths as standard input to svn add command:

    [user@xxx rails]$svn st | grep ? | tr -s ' ' | cut -d ' ' -f 2 | xargs svn add
    A       app/controllers/application.rb
    A       config/database.yml
    

     

  • 相关阅读:
    ASPxGridView之ASPxGridViewExporter
    Asp.net中,从弹出窗体取选择值
    ASPxGridView中常用操作
    asp.net Webconfig
    白皮书 CPU卡基本知识
    Linux 中的计时 转自IBM china
    网络无缝融合技术(转)
    UMA相关的网站
    几本不错的书
    手机基带芯片供应商严阵以待,备战3G市场
  • 原文地址:https://www.cnblogs.com/AloneSword/p/5095890.html
Copyright © 2011-2022 走看看