SVN set up for multiple projects
just a quick tutorial how to set up subversion, aka SVN to be used with multiple projects.
Setting up only one repository has the downside of incrementing revision number for all the projects no matter what project is modified. The logs tend to be messy too which I don’t like.
so let’s begin:
1. create a repository for let’s say projects
svnadmin create /home/demo/repo/project1
svnadmin create /home/demo/repo/project2
where repo, project1 and project2 are all directories that must be previously created
2. import the projects
a. copy the projects to the server – let’s say to /home/demo/project1 and /home/demo/project2
b. execute
svn import /home/demo/project1 file:///home/demo/repo/project1 -m “initial import of project1”
svn import /home/demo/project2 file:///home/demo/repo/project2 -m “initial import of project2”
Note: I am not using trunk branches and tags directories here just to keep things simple.
3. start up the server so we can checkout the projects remotely
svnserve -d -r /home/demo/repo/
Please note that using svnserve you can grant read/write permission to a certain user. Because we have separate repositories you need to configure the permissions for each repository. This is a little downside with having multiple repositories but I can live with that :)
4. setting up permissions
each repository will have a conf/svnserve.conf and a conf/passwd file. Edit svnserve.conf and add under [general]:
yourSvnUserForProject1 = write
anon-access = none
auth-access = write
password-db = passwd
realm = project1
edit passwd:
yourSvnUserForProject1=aPassword
5. done install on your local pc TortoiseSVN, create a dir where you want the project 1 do be checkout, right click->checkout add svn://serveip/repo/project1 as url and then you will be asked for username pass (yourSvnUserForProject1=aPassword)
6. of course you also need to checkout the project to where your website will be live:
svn co svn://serverip/repo/project1
or if your website is already live and don’t want a downtime:
svn co svn://serverip/project1/ ./ –username xxx –password xxx –force
There is a lot more where it comes to subversion but I hope managing multiple projects with svn in the aproach I choose will prove to help others too.