Pls. see Creating a Subversion branch. I created a repository with a URL http://reposerver/svn/repository/ and checked out a working copy and started adding files to the root instead of doing it into the trunk folder.
Now, we need to create a branch except we don't have a "trunk" folder. From the above link, user "Wrikken" suggested that we "Possible workaround is to create a folder trunk now, and move the current content of the root sans branches dir into that location. "
Now, we don't know how to do "move the current content of the root sans branches dir into that location". What command should we use to do the same ?
When we do ls -la of /var/svn/repository, here's what we see
total 32
drwxr-xr-x 2 www-data subversion 4096 2010-12-28 18:20 conf
drwxr-xr-x 3 www-data www-data 4096 2010-12-28 18:23 dav
drwxr-sr-x 6 www-data subversion 4096 2010-12-28 18:31 db
-r--r--r-- 1 www-data subversion 2 2010-12-28 18:20 forma开发者_JS百科t
drwxr-xr-x 2 www-data subversion 4096 2010-12-28 18:20 hooks
drwxr-xr-x 2 www-data subversion 4096 2010-12-28 18:20 locks
-rw-r--r-- 1 www-data subversion 229 2010-12-28 18:20 README.txt
-rw-r--r-- 1 root root 95 2010-12-28 18:41 svn-commit.tmp
TL DR : We need to create a branch and our repository does NOT have "trunk" and "branches" so what commands do we need to use to move existing repository content to a trunk directory ?
Thank you,
Execute the following commands in the root of a working copy of the repository (ls
should output the contents of your repository, not the files and directories quoted in the question).
svn mkdir trunk
svn mv `ls | egrep -v '^branches$` trunk
svn ci -m 'Create trunk dir and move trunk contents into it.'
egrep -v '^branches$
matches everything except branches
. The mv
command will be clever enough to not try move trunk
into itself, although it will yell at you with an error you can safely ignore.
Use the subversion client of your choice. It should have a move operation. (Unlike CVS, moving a file/directory in subversion retains the history of the moved file/directory.)
For example, if your are using the Tortoise SVN client, here's the relevant part of the help file:
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-rename.html
精彩评论