In my last article I illustrated how to install Enlightenment by checking out the most recent code from the Enlightenment Subversion Server (see "Installing Enlightenment E17 using subversion"). After that article I thought it would be a good follow up to illustrate how to create your own subversion repository.
Why? What can you use a subversion repository for? If you are collaborating on an application project in which multiple users need to be able to check in and check out your code, you will definitely want to use a solution such as subversion. There are other, interesting possibilities, for using subversion...such as a repository for documentation that is
In this process we are going to create a repository called myrepository and a project within that repository called "myproject". For simplicity sake we are going to house that repository in our ~/ directory. This is only used for simplicity (to avoid permissions issues). Once you have gained an understanding of how to work with subversion, we'll discuss creating repositories that can be accessed from without.
Here are the steps for creating your subversion repository.
Step 1: Install Subversion
Step 2: Create your repository
svnadmin create ~/repository
Step 3: Create project folders within ~/myrepository. Once you have created the directory structure, you can then move the pre-existing project files into the trunk folder. If this is a new project (that no work has been done) you can start saving your project files to the trunk folder. The folder structure needs to look like this:
Step 4: Create an svn user. This will be the user(s) that are allowed access to the project. The first step is to edit the ~/myrepository/conf/svnserve.conf file and add the following to the end of the file:
anon-access = none
auth-access = write
password-db = passwd
The next step is to edit ~/myrepository/conf/passwd and add the following to the end of the file:
user = user password
Where user is the username and password is the password for the user.
Step 5: Now it's time to import your project. From within your ~/myrepository direcotory issue the command:
svn import project1/ svn+ssh://user@ADDRESS/home/USER/myproject/project1 -m "Original Commit"
Where ADDRESS is the location of the machine housing the repository and USER is the actual user name. NOTE: The above command is all one line. When that command runs successfully you will be prompted for the user password. Once you correctly enter the user password you will see scroll by a number of lines all beginning with "Adding". That tells you all of your project files/folders have been added.
Step 6: Start the daemon. In order for other uses to be able to access that repository you have to run the subversion daemon. To start this, issue the command:
You can now check out and check in your project files on your svn repository.
This has been a very basic introduction to setting up a subversion server. The next time around we are going to take this to the next level and set up a subversion server that others can check in and check out files.Advertisement
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.