![]() |
|||||||||||||||||||||||||||
|
This page was last modified: November 04 2006 13:24:42 | ||||||||||||||||||||||||||
SubversionI have used CVS in the past, but always as a committer, never as an administrator. So when I decided to put some version control on this site, my knowledge was very limited. I asked around and decided to use subversion. The first lesson I learned was that you should never save application generated content in the same directory as the actual application (e.g. a webpage) ... big mistake! If for example you are maintaining an online photoalbum, never save the pictures in a subdirectory. It will come back and bite you when the time comes to add version control. I strongly recommend reading the subversion book "Version control with subversion". It's free and can be downloaded from the subversion website. This article is based on the lessons I learned while creating an initial repository and adding nerdgirl.dk into it. First I reinstalled Apache, since it was not compiled with berkeley.
cd /usr/ports/www/apache20/ And I did the following because they told me to at www.bsdguides.org/guides/freebsd/misc/subversion.php. Actually I am not sure if it is necessary or not.:
We make sure that the apache2 aprutil library is known, this file sometimes seems to get "lost"
Next, install subversion:
cd /usr/ports/devel/subversion Create a repository: svnadmin create /usr/local/www/subversion Create an initial project with the layout they recommend in the subversion book:
mkdir /root/nerdgirl.dk/ Copy the working website into the 'trunk' cp -r /usr/local/www/nerdgirl.dk/ /root/nerdgirl.dk/trunk/ Imported the project to the new repository: svn import /root/nerdgirl.dk file:///usr/local/www/subversion/nerdgirl.dk -m "Initial import" Delete the project... rm -rf /root/nerdgirl.dk If for some reason you want to start over from scratch, just delete the root directory (ind this example, that would be the 'subversion' directory). rm -rf /usr/local/www/subversion In a professional environment they have seperate servers for developing and testing stuff. I dont. Well, I could install Apache on my laptop and do my programming there, but I think it's a bit overkill for this. So instead I decided to use a password protected sub domain as my working copy: test.nerdgirl.dk Then did a checkout to get the code from the repository (this command will fetch the project and create the test.nerdgirl.dk folder): svn checkout file:///usr/local/www/subversion/nerdgirl.dk/trunk/ test.nerdgirl.dk I also did a checkout to the public site: svn checkout file:///usr/local/www/subversion/nerdgirl.dk/trunk/ www.nerdgirl.dk Now I can test and fool around on test.nerdgirl.dk. When I'm done, I commit the changes and update the public site:
pwd That's all for the initial setup... Here's a page with the most frequently used commands.
Inspired by: www.bsdguides.org/guides/freebsd/misc/subversion.php How to use subversion to version control system configuration files: |
|||||||||||||||||||||||||||