Save your dream,Save your life!

导航

统计

公告

2011年4月3日 #

HelloWorld for SVN

Section one

Environment:

PC system : ubuntu9.10

Subversion: 1.6.5


The /var/www is project path you need to change 

 

Step1 Installation

sudo apt-get install subversion libapache2-svn



Step2 set the permission and access type

sudo groupadd subversion
sudo mkdir /home/svn/myproject
sudo cd /home/svn
sudo chown -R www-data:subversion myproject
sudo chmod g+rws myproject



now, you can visit it by this link http://localhost/svn/myproject

you need to edit the config of the apache for svn, just check here,
https://help.ubuntu.com/8.04/serverguide/C/subversion.html
In detail of access methods , see link: https://help.ubuntu.com/community/Subversion )

Config the apache
sudo vim /etc/apache2/mods-available/dav_svn.conf

 

<Location /svn/myproject>
<SVNPath /home/svn/myproject>
 AuthType Basic
 AuthName 
"repository myproject"
 AuthUserFile 
/etc/subversion/passwd 

 
<LimitExcept GET PROPFIND OPTIONS REPORT>
  Require valid-user
 
</LimitExcept> 

</Location>
sudo /etc/init.d/apache2 restart












Section two

Step1 create repository and import project
sudo svnadmin create /home/svn/myproject
sudo svn import /var/www/myproject file:///home/svn/myproject -m 'initial import of the phpsse project'


Step2 check out your copy of the project
cd /var/www/
mv myproject myproject.bak

svn checkout file:///home/svn/myproject myproject

now , you could modify and edit the files in this directory(/var/www/myproject)
then , "svn update, svn commit it"

more detail, http://onlamp.com/pub/a/onlamp/2002/10/31/subversion.html?page=2

Step3 How to make directory, rename , delete, make file
cd /var/www/myproject
svn mkdir foo
sudo svn ci -m 'test mkdir'

svn mv foo aoo
sudo svn ci -m 'test rename'

svn del aoo
sudo svn ci -m 'test delete'

touch file.txt
svn add file.txt
sudo svn ci -m 'test for adding a file'

If you wanna know the modification of repository, take this command
svn update
svn ls
svn st -u (svn st -v, or svn st -v -u)
svn log

svn cleanup
(this is will cleanup your working copy in local , it return a message when you commit)

posted @ 2011-04-03 11:47 coolesting 阅读(73) 评论(0) 编辑