Batch file to Checkout all root level project trunks in a Subversion repository

Our source control tree is setup with the projects at the root of our server and each has a separate trunk, tags, and branches.  While this makes it very easy to have a location agnostic build and include all the dependencies in one place for a particular project, this aspect can be painful when you want to checkout the trunk of each project to a new developer machine.  I wrote a little batch file to ease the pain.

Sample Source Control Repository



ect …


Batch file to pull checkout all of the trunks.

   1: set svnbin="d:Program FilesCollabNet Subversion Serverbinsvn.exe"
   2: set svnroot=http://sourceserver:8080/svn/cgi/
   3: %svnbin% list %svnroot%>projects.txt
   4: FOR /F "tokens=1" %%i IN (projects.txt) DO %svnbin% checkout %svnroot%%%itrunk %%i


Subscribe to this feed:

This is pretty easy to modify, simple replace your bin location for subversion executable and update the svnroot to the path to your subversion repository and you are good to go.  The one important gotcha here is that subversion is case sensitive.  I ran into a problem where our repository has some of the trunks starting with a lowercase t and other starting with a uppercase t.  In that case, I just added an additional line 4 with the uppercase Trunk.  That batch file roles on without stopping if there is a mismatch in the case of trunk.

About Eric Hexter

I am the CTO for QuarterSpot. I (co)Founded MvcContrib, Should, Solution Factory, and Pstrami open source projects. I have co-authored MVC 2 in Action, MVC3 in Action, and MVC 4 in Action. I co-founded online events like mvcConf, aspConf, and Community for MVC. I am also a Microsoft MVP in ASP.Net.
This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • freemason

    Hello, I have a need to checkout all the projects in the main repository and its trunk,branches,tags to local computer, how would i do that? I am using tortoiseSVN,

    set svnbin=”C:Program FilesTortoiseSVNbinsvn.exe” —– is it correct

    set svnroot= ———– is it correct

    %svnbin% list %svnroot%>projects.txt —- do i type down the project names in a text file if so where do i save it?

    FOR /F “tokens=1″ %%i IN (projects.txt) DO %svnbin% checkout %svnroot%%%itrunk %%i — what should this be modified to ?

    Please help.

    • pankaj jain

      d:Program FilesCollabNet Subversion Serverbinsvn.exe what is the use of this .exe file .

      my requirement is i want to take checkout my all product
      can i right the script like this .when i run the commond it will get the all the product detail from text file and done the checkout