View mail in queue« an older post

Importing existing directory structure into new svn repository

Snippet

For existing files, create and import directory structure into a new svn repository.

# create repository
cd path/to/repo
mkdir svnroot
svnadmin create path/to/repo/svnroot
 
# change to the webroot directory
# normally includes the webroot / website directory 
# such as cd ~/Sites/8080/website
cd path/to/webroot
 
# import the files into the repository
# note the last path segment includes the webroot directory name
svn import file:///...path/to/repo/webroot
 
# move the original directory away and checkout the files 
cd ..
mv webroot webroot-preimport
svn co file:///...path/to/repo/webroot
 
# and into the webroot for editing
cd webroot
 
 
# actual history for cut and paste:
 
% pwd
/home/kitt/sites/8080
% ls -1
logs
website
% mkdir svnroot
% ls -1
logs
svnroot
website
% svnadmin create /home/kitt/sites/8080/svnroot
% cd website
% svn import file:///home/kitt/sites/8080/svnroot/website
% cd ..
% mv website website-preimport
% svn co file:///home/kitt/sites/8080/svnroot/website
A    website/a
A    website/a/index.php
A    website/index.php
...
A    website/.htaccess
Checked out revision 1.
% ls

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.