SVN command to delete all locally missing files

后端 未结 12 2381
说谎
说谎 2020-12-12 09:13

In SVN is there a command I can use to delete all locally missing files in a directory?

Or failing that, some way of listing only those files that are missing (or, i

12条回答
  •  佛祖请我去吃肉
    2020-12-12 09:55

    This shell script, recursively examines (svn status) directories in your project, removing missing files (as the question demands) 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
    

提交回复
热议问题