[wiki]SubVersion
发表于 : 2005-10-01 12:18
SubVersion for repository administrators (using Apache)
In order to create a repository you need to follow these steps (do it with sudo or in a root shell):
Install the needed packages, which are in the Universe repository. For more information on adding repositories, see AddingRepositoriesHowto.
apt-get install subversion
apt-get install libapache2-svn
Create a virtual host in Apache2's configuration file /etc/apache2/apache2.conf and point it to /home/svn. Configuration sniplet:
<Location /faq>
DAV svn
SVNPath /home/svn/faq
AuthType Basic
AuthName "Documentation Team Repository"
AuthUserFile /etc/subversion/passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
(Important: Don't use a DocumentRoot setting for this virtual host!")
Restart apache (if needed):
/etc/init.d/apache2 reload
Create the repository:
svnadmin create /home/svn/faq
Create a password file:
htpasswd2 -c /etc/subversion/passwd [username]
Try accessing it:
lynx http://server/faq
(You will not be prompted for credentials. That's normal.)
Try to check out the file:
svn co http://server/faq
Voila. The repository is set up.
SubVersion for repository users
To checkout (=download) the files in the repository for the very first time run this command::
svn co http://server/faq
Don't worry about other people working on the same files. Just do your changes to the files and when you seem to have a stable state (make sure everything works well enough so not everything will break for others) you should check in your work::
svn ci
(Only when committing your changes you will be prompted for your username and password.)
Run the following command regularly to get the changes from other contributors::
svn update
If you want to add new files to the repository::
svn add [filename]
To get a status of which files have changed::
svn stat
SubVersion for local repositories
This type of istallation is used when you want subversion to track your local files but don't want/need to put it on a host. You can create a local repository and access it directly. This repository is not password protected and it's permissions depend on the filesystem's permissions.
Install the needed packages (as root or with sudo):
apt-get install subversion
Create the repository (with your user):
svnadmin create /home/joe/repositorie
The url to your repository is it's path preceeded with file://. For example to checkout you would do the following::
svn co file:///home/joe/repositorie
Resources
* [WWW] Subversion's Official Homepage
* [WWW] Online free book: Version Control with Subversion
*Christoph Haas, Tiago Cogumbreiro*
From JoshBjornson Mon Jan 31 09:52:17 +0000 2005 From: Josh Bjornson Date: Mon, 31 Jan 2005 09:52:17 +0000 Subject: Setup instructions not complete Message-ID: <20050131095217+0000@[WWW] https://www.ubuntulinux.org>
There is one thing missing from the apache setup to get it working properly. "/home/svn" and all files it includes must be accessable by the process that apache runs as, so the following command must be run:
chown -R www-data.www-data /home/svn
https://wiki.ubuntu.com/SubVersion
In order to create a repository you need to follow these steps (do it with sudo or in a root shell):
Install the needed packages, which are in the Universe repository. For more information on adding repositories, see AddingRepositoriesHowto.
apt-get install subversion
apt-get install libapache2-svn
Create a virtual host in Apache2's configuration file /etc/apache2/apache2.conf and point it to /home/svn. Configuration sniplet:
<Location /faq>
DAV svn
SVNPath /home/svn/faq
AuthType Basic
AuthName "Documentation Team Repository"
AuthUserFile /etc/subversion/passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
(Important: Don't use a DocumentRoot setting for this virtual host!")
Restart apache (if needed):
/etc/init.d/apache2 reload
Create the repository:
svnadmin create /home/svn/faq
Create a password file:
htpasswd2 -c /etc/subversion/passwd [username]
Try accessing it:
lynx http://server/faq
(You will not be prompted for credentials. That's normal.)
Try to check out the file:
svn co http://server/faq
Voila. The repository is set up.
SubVersion for repository users
To checkout (=download) the files in the repository for the very first time run this command::
svn co http://server/faq
Don't worry about other people working on the same files. Just do your changes to the files and when you seem to have a stable state (make sure everything works well enough so not everything will break for others) you should check in your work::
svn ci
(Only when committing your changes you will be prompted for your username and password.)
Run the following command regularly to get the changes from other contributors::
svn update
If you want to add new files to the repository::
svn add [filename]
To get a status of which files have changed::
svn stat
SubVersion for local repositories
This type of istallation is used when you want subversion to track your local files but don't want/need to put it on a host. You can create a local repository and access it directly. This repository is not password protected and it's permissions depend on the filesystem's permissions.
Install the needed packages (as root or with sudo):
apt-get install subversion
Create the repository (with your user):
svnadmin create /home/joe/repositorie
The url to your repository is it's path preceeded with file://. For example to checkout you would do the following::
svn co file:///home/joe/repositorie
Resources
* [WWW] Subversion's Official Homepage
* [WWW] Online free book: Version Control with Subversion
*Christoph Haas, Tiago Cogumbreiro*
From JoshBjornson Mon Jan 31 09:52:17 +0000 2005 From: Josh Bjornson Date: Mon, 31 Jan 2005 09:52:17 +0000 Subject: Setup instructions not complete Message-ID: <20050131095217+0000@[WWW] https://www.ubuntulinux.org>
There is one thing missing from the apache setup to get it working properly. "/home/svn" and all files it includes must be accessable by the process that apache runs as, so the following command must be run:
chown -R www-data.www-data /home/svn
https://wiki.ubuntu.com/SubVersion