svn: make the branches directory before make a branch

Thursday, August 23rd, 2007

Well, this is a short note to myself so the next time I want to create a branch of a new project, I won’t need to search through the Internet.

Before doing

$ svn copy \ \
-m "Creating a private branch of /calc/trunk."

to make a new branch of a new project (which don’t have any branches yet), I’ll need to do

svn mkdir \
-m "make the branches directory to hold all the branches"


Or I’ll get an error message like

svn: Path ‘branches’ not present

The reason is, like the error message said, there is no directory “branches” in the repo, and svn copy, like the “cp” command, won’t make a directory if it’s not there. It will assume I made a typo. A safe guard. And I need to explicitly create the directory.

Tags: ,

Comments 12

  1. Michael Ben-Nes wrote:

    Thanks, just what I was looking for.

    Posted 10 Apr 2008 at 4:46 pm
  2. Vish Challagonda wrote:

    You could use “–parents” switch on the “svn copy” command - it makes intermediate directories if they do not exist.
    For more options, do “svn copy –help” at CLI

    Posted 11 Mar 2010 at 11:11 pm
  3. rwrick44 wrote:

    the blog is very nice
    The Personal Injury specialists at The Mastrangelo Law Offices offer a free no obligation initial consultation.

    Posted 28 Sep 2010 at 1:42 pm
  4. Luis wrote:

    Sweet, cheers dude.

    Posted 03 Feb 2011 at 12:21 am
  5. Kumar wrote:

    Thanks! it saved my time.

    Posted 24 Mar 2011 at 1:08 pm
  6. Bragaadeesh wrote:

    Thank you !

    Posted 05 May 2011 at 7:13 pm
  7. Bobby wrote:

    Thanks! I was looking for this for ages. In case it helps drive SEO - I was looking for how to add a branches directory to my existing SVN repository and was getting the error:

    svn: Path ‘branches’ not present

    This solved my problem!

    Posted 12 Mar 2012 at 2:52 pm
  8. rockvilla wrote:

    Thanks saved my time!!

    Posted 20 Mar 2013 at 3:04 pm
  9. tim wrote:

    yup - I needed to do this as well. It’s a bit weird that the SVN documentation doesn’t mention you need to do this. The import command creates the directory for you, but copy doesn’t. Either way, thanks!

    Posted 31 Oct 2014 at 6:52 am
  10. Clint wrote:

    I was struggling with this issue and am glad Google sent me to your page. Thank you!

    Posted 01 Jul 2015 at 7:11 am
  11. jaogames wrote:

    Jao Games is a free online cartoon flash games site where you can find games from all your favorite cartoons such as Ben10, Dora, Tom and Jerry, Spongebob and many more.

    Posted 05 Sep 2015 at 10:22 am
  12. dan wrote:

    Cool, had no idea you could use “svn mkdir”. This is awesome for creating branches without copying the entire trunk contents. If you’d try to copy just one subfolder, you’d get an error that its parent wasn’t available. And if you’d try to copy to its parent folder, it would get all the trunk contents. Awesome.

    Posted 18 Apr 2016 at 6:32 pm

Post a Comment

You could use <code type="name"> to get your code colorized

Your email is never published nor shared. Required fields are marked *

E-mail It