Add all unversioned files to Subversion using one Linux command

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

    This shell script, recursively examines (svn status) directories in your project, removing missing files and adding new files to the repository. It is some sort of "store into the repository the current snapshot of the project".

    if [ $# != 1 ]
    then
        echo  "usage: doSVNsnapshot.sh DIR"
        exit 0
    fi
    
    ROOT=$1
    
    for i in `find ${ROOT} -type d \! -path "*.svn*" `
    do
    
        echo
        echo "--------------------------"
        ( cd $i ; 
        echo $i
        echo "--------------------------"
    
    
        svn status | awk '  
                /^[!]/ { system("svn rm " $2) }
                /^[?]/ { system("svn add " $2) }
            '
        )
        echo
    
    done
    

提交回复
热议问题