This is a guide for a single user to setup a barebones SVN repository quickly and without any extra confusing instructions.
The following steps will show how to 1.setup a repository for a project, 2. import files into the repo, 3. pull them out into a different folder, and 4. submit changes back to the repo. Before starting, make sure you have subversion installed (sudo apt-get install subversion) on all the computers you will be using. For this howto I’ll be using the server “closetbox” and the client “icebox”. Both are running Ubuntu Linux.
- Create an SVN repository for a project on the server.
[email protected]:# sudo mkdir /var/svn
[email protected]:# sudo svnadmin create /var/svn/frozenindustries
[email protected]:# sudo chmod 770 /var/svn/frozenindustries
[email protected]:# sudo chown nick:nick /var/svn/frozenindustries
- Import files into the repository. I’m going to send over a wordpress blog which is sitting in a folder called “htdocs” on my desktop. This is only done once, after this files are updated using “ci”.
[email protected]:# svn import -m “look, i’m importing” htdocs/ svn+ssh://closetbox/var/svn/frozenindustries/trunk
- Get your data back out of SVN an put it in a folder on the client where you’ll work on it.
[email protected]:# svn co svn+ssh://closetbox/var/svn/frozenindustries/trunk fi/
- After making changes to files in fi, send the changes back to the server. SVN knows which server you checked out from by saving data in a .svn folder. It’ll pop open your default text editor to show the changes. Since we’re trying to be as simple as possible, just assume everything is correct, quit the text editor, and say “c)ontinue”
[email protected]:# svn ci fi/
That’s it. Repeat steps 3 and 4 to grab copies of you project and submit changes.