Can you do a partial checkout with Subversion?

后端 未结 7 716
傲寒
傲寒 2020-11-28 01:20

If I had 20 directories under trunk/ with lots of files in each and only needed 3 of those directories, would it be possible to do a Subversion checkout with only those 3 di

7条回答
  •  渐次进展
    2020-11-28 01:27

    Indeed, thanks to the comments to my post here, it looks like sparse directories are the way to go. I believe the following should do it:

    svn checkout --depth empty http://svnserver/trunk/proj
    svn update --set-depth infinity proj/foo
    svn update --set-depth infinity proj/bar
    svn update --set-depth infinity proj/baz
    

    Alternatively, --depth immediates instead of empty checks out files and directories in trunk/proj without their contents. That way you can see which directories exist in the repository.


    As mentioned in @zigdon's answer, you can also do a non-recursive checkout. This is an older and less flexible way to achieve a similar effect:

    svn checkout --non-recursive http://svnserver/trunk/proj
    svn update trunk/foo
    svn update trunk/bar
    svn update trunk/baz
    

提交回复
热议问题