Add all unversioned files to Subversion using one Linux command

前端 未结 11 1752
滥情空心
滥情空心 2020-12-23 09:24

Sometimes I include many files in different directories in my project. For now I am adding all files one by one to my project before commit. Is there any Linux terminal comm

11条回答
  •  孤城傲影
    2020-12-23 09:56

    The above-mentioned solution with awk '{print $2}' does not unfortunately work if the files contain whitespaces. In such a case, this works fine:

    svn st | grep "^?" | sed 's/^?[ \t]*//g' | sed 's/^/"/g' | sed 's/$/"/g' | xargs svn add
    

    where

    sed 's/^?[ \t]*//g'
    

    removes the question mark and empty characters from the beginning and

    sed 's/^/"/g' | sed 's/$/"/g'
    

    encloses the filenames with quotes.

提交回复
热议问题