SVN: Checkout/export only the directory structure

后端 未结 12 1109
花落未央
花落未央 2020-12-08 19:14

Is there a way to perform a SVN checkout (or export), which would fetch only the directory structure; that is to say, no files?

12条回答
  •  囚心锁ツ
    2020-12-08 20:05

    Just wanted to add, if you need to do this server-side (i.e. not checking out the repository first), the equivalent to svn ls is svnlook tree --full-paths. I had to create a copy of a 50GB repo's folder structure and used the hints I found here to do it without having to create a working copy of the whole thing.

    My code was:

    svnlook tree /path/to/repo --full-paths | grep "/$" | grep -v "^/$" | xargs -I {} mkdir -p "{}"

    The grep -v "^/$" because the output contained a single / (i.e. file system root folder) and I didn't want to mess around with that.

提交回复
热议问题