How to create trunk directory in existing svn repo without a trunk, and move all files to new trunk?

前端 未结 1 684
闹比i
闹比i 2020-12-21 04:09

I\'ve got an svn repo with no trunk dir. I\'d like to create the trunk and branches dirs, and move all my files (currently in the root) into trunk.

Creating trunk wo

相关标签:
1条回答
  • 2020-12-21 04:48

    You're using a MacBook, so let's assume bash for your shell:

    # Select all the relevant files/directories (less trunk, branches, and tags)
    ls * | egrep -v "trunk|branches|tags" > /tmp/files
    
    # Move them within the repository
    svn move $(cat /tmp/files) trunk
    

    This will work as long as you don't have spaces in your file names. If you do, then use this instead:

    # Select all the relevant files/directories (less trunk, branches, and tags)
    ls * | egrep -v "trunk|branches|tags" > /tmp/files
    
    # Move them within the repository
    cat /tmp/files | while read file ; do
        svn move "${file}" trunk
    done
    
    0 讨论(0)
提交回复
热议问题