Here is a quick tutorial that will walk you through step by step to setup and configure Subversion on Ubuntu. This will get you going whether your installing on your local machine or deploying Subversion to a server where you will be hosting lots of projects.
Step 1: Update Software and Grab Tools
You should always start off the same way and ensure your system is up to date, and has the tools you will need.
sudo apt-get update sudo apt-get install openssh-server
Step 2: Install Subversion
This will install Subversion, and set the base for you to use to create your repositories:
sudo apt-get install subversion
Step 3: Security
At this step we will setup a security structure that will allow for expansion, but will not be too complex for the average home user. We will first create a group named ’svn’ and then add yourself and any other users you want to be able to access your repository.
sudo addgroup svn sudo gpasswd -a yourusername svn
Step 4: Additional Security
Next you will need to add a place to store your repositories, and will need to set permissions there that match what you did for step 3.
sudo mkdir /home/repos sudo chown root:svn /home/repos sudo chmod -R 770 /home/repos
In order for the changes from steps 3 and four to take effect relating to the security group ’svn’ that we created you will need to reboot your machine. I suggest you bookmark this page and save any open work, because the next command will restart your machine:
sudo rebootStep 5: Create Your Repository
Now that you have rebooted, you should be able to create a new repository in the directory /home/repos
Be sure to not use sudo on this step.
svnadmin create /home/repos/reponame
If all goes well and you don’t receive any errors, then go on to step 6. If you do receive permissions errors, go back to step 4 and run the second and third commands once again.
Step 6: Add Files To Your Repository
Now that you have your repository up and running you can go ahead and add files to it. Assuming you have a project named mycoolapp that is stored in /home/youruser/ you would type this command to import it:
svn import /home/youruser/mycoolapp file:///home/repos/reponame -m "initial import"
Step 7: Checkout Your Project
Now that your project is stored in your repository you will need to check it out to work on it and make changes. Be sure to change the server name to the name of your machine.
svn co svn+ssh://servername.com/home/repos/reponame
That’s it! The next steps you may want to do include:
a) Learn more about Subversion with the free online svnbook: http://svnbook.red-bean.com/
b) Setup Subversion to be accessible with Apache2 and WebDAV: (Article coming soon, let me know if you need it quickly)
Popularity: 46%
Related Posts
No related posts.



Write a Comment