Search code examples
svnrepositorysvnadmin

create multiple svn repositories at once


I am migrating a bunch of existing projects (without version control) into svn.

I was wondering if there is a way to create multiple repositories at once on the command line.

svnadmin create repo1 repo2 repo3 etc.

I realize the above wont work, since that is not the parameters expected.

I know this is probably more a case of a generic solution like

ls FileWithRepoNames | svnadmin create ______

but was not sure how to do this.

Thanks!


Solution

  • Have you tried:

    for i in `cat FileWithRepoNames`;
    do
        svnadmin create $i;
    done;
    

    Ls is used to list the contents of a directory. I assumed you wanted to read the names from a file, in which case you need to use cat.

    Note that "cat" in this context this will split the file into seperate words, not lines.