Add all unversioned files to Subversion using one Linux command

前端 未结 11 1745
滥情空心
滥情空心 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:52

    This version of the above commands takes care of the case where the committed files or the paths to them contain spaces. This command will still fail, though, if the path contains a single quote.

    svn st |grep ^?| cut -c9-| awk '{print "\x27"$0"\x27"}' | xargs svn add
    

    I went for the cut -c9- to get rid of the leading spaces and assuming that the svn st command will start filename at the 9th character on all machines. If you are unsure, test this part of the command first.

提交回复
热议问题