Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn checkout depth

I have an SVN project with tree like this:

/project     /dir1         /subdir1            -file1            -file2             .....         -file1         -file2         .....     /dir2         -file1         -file2         .....     /dir3         /subdir1            -file1            -file2             .....         /subdir2            -file1            -file2             .....         /subdir3            -file1            -file2             .....         /subdir4            -file1            -file2             .....     /dir4         -file1         -file2         ..... -file1 -file2 

I need to checkout

  • all files from /project
  • full /dir1
  • full /dir2
  • full /dir4
  • From /dir3 I need only /subdir1 and /subdir3

Can I checkout these files/folders using svn commandline with some kind of depth? If so how can I do it? Can I add subdir2 to dir3 after a checkout? How can I update working copy created this way? Will normal "svn up" command update only these folders or full update of project will be performed?

like image 411
Pablo notPicasso Avatar asked Jul 25 '12 12:07

Pablo notPicasso


People also ask

What is checkout depth in svn?

SVN checkout has a handy --depth with the following options (from the documentation): --depth empty : Include only the immediate target of the operation, not any of its file or directory children. --depth files : Include the immediate target of the operation and any of its immediate file children.

How do I checkout a trunk in svn?

What you can do is to create a new project add define external links from it to every other projects trunks. External link works like softlink. You can then chekout everything in one step.

What is checkout in Subversion?

Advertisements. Subversion provides the checkout command to check out a working copy from a repository. Below command will create a new directory in the current working directory with the name project_repo.


1 Answers

What you need is called sparse checkout.

In your case you can:

svn co --depth files file:///project project cd project svn up --set-depth infinity dir1 dir2 dir4 svn up --set-depth empty dir3 svn up --set-depth infinity dir3/subdir1 dir3/subdir3 

Can I add subdir2 to dir3 after a checkout?

Yes: svn up --set-depth infinity dir3/subdir2

How can I update working copy created this way? Will normal "svn up" command update only these folders or full update of project will be performed?

Yes, svn up will update only these files and folders, that is update depth will be preserved.

like image 163
ks1322 Avatar answered Sep 22 '22 17:09

ks1322