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 9

  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

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