brief
hardware: raspberrypi
os:raspbian
install subversion
sudo apt-get install subversion
create repository
1. create a folder to put repositories
mkdir -p /usr/svn/repos
2. create a repository
svnadmin create /usr/svn/repos/hellosvn
set up remote access over http
1. install http server apache2
sudo apt-get install apache2 libapache2-svn
2. edit dav_svn.conf at /etc/apache2/mods-available/dav_svn.conf
sudo nano /etc/apache2/mods-available/dav_svn.conf
add content below to the bottom of the file
<Location /svn>
DAV svn
SVNParentPath /usr/svn/repos
AuthType Basic
AuthName "Subversion Repo"
AuthUserFile /etc/apache2/dav_svn.passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
3. restart apache
sudo /etc/init.d/apache2 restart
4. change the permission of the repository folder
sudo chown -R www-data:www-data /usr/svn/repos/hellosvn
5. create the first svn user
sudo htpasswd -c /etc/apache2/dav_svn.passwd [user]
now, you can check your repo through a web browser on your Raspberry Pi using IP address.
add a user
1. add a user
sudo htpasswd /etc/apache2/dav_svn.passwd [user]
2. change the permission of the repository folder
sudo chown -R www-data:www-data /usr/svn/repos/hellosvn
3. restart apache
sudo /etc/init.d/apache2 restart
add a repository
1. create a folder to put repositories
mkdir -p /usr/svn/repos
2. create a repository
svnadmin create /usr/svn/repos/hellosvn
3. change the permission of the repository folder
sudo chown -R www-data:www-data /usr/svn/repos/hellosvn
4. restart apache
sudo /etc/init.d/apache2 restart
repository migration
1. 查看当前版本库最新的版本号(@server)
svnlook youngest [repo]
2. 导出旧的版本库(@server)
svnadmin dump [repo] -r [lower-revision]:[upper-revision] > [file]
3. 导入新的版本库(@server)
svnadmin load [repo] < [file]
4. 查看当前工作区的映射关系(@client)
svn info
5. 为当前工作区切换repository (@client)
svn switch --relocate [old-repo-url] [new-repo-url]
ref
1. http://www.jeremymorgan.com/tutorials/raspberry-pi/raspberry-pi-how-to-svn-server
2. http://www.blogjava.net/pengpenglin/archive/2008/12/26/248405.html
扫描二维码,分享此文章