Here are some quick commands
Creating a repository
>svnadmin create [path to repo]
Eg :
>svnadmin create /usr/local/svn/myrepo
svnadmin is a server side command. So we have to give paths here and not url
Importing files to repository
Used to import files to the repository mostly at the initial setup.
>svn import [dir name] [repo url] -m ”Message”
It is necessary to physically copy files to the server before importing it.
Eg:
> svn import myproj file:///usr/local/syn/myrepo -m “Initial Import”
Checking out files from repositories
>svn checkout [repo url]
Eg : >svn checkout svn://svnhost.example.com/myrepo
Committing files to repository
This will push the updated local files to repository and will be made available to other team members.
>svn commit [reponame] -m “Message”
Eg: >svn commit myrepo -m “JSP Files Update”
Updating files from repository
This will pull the files newly updated by others in the team to your local working directory.
>svn update [repo name]
Eg: svn update myrepo
Setting up user/password for a repository
Edit file svnserve.conf in repositories conf directory. Uncomment these lines
# password-db = passwd
# realm = My First Repository
Then edit passwd file.
Running simple svn server
The easiest option is to run it as a standalone server. The default port it connects is 3690
>svnserve -d -r[path of repo]
Eg :
>svnserve -d -r /usr/local/repos
Then it can be accessed remotely like
>svn checkout svn://host.exmple.com/myrepo
Hosting multiple repositories
I have a folder named svnrepos in which I create all the repositories say abc and xyz. Now when I start the svnrepos with svserve like
> svnserve -d -r [path]/svnrepos
all the repositories get started. They can be accessed like
> svn list svn://[host name]/abc
Some random problems :
After setting up svn i was able to checkout the files and work on them. But when i try to commit it would say ‘connection is read only‘. I had to edit svnserve.conf file in the conf directory of the repository. I uncommented password-db=passwd line and realm=xyz line though the latter step may not be necessary. Then I added a passwd file to the conf directory with the following contents.
[users]
myname=mypassword
But then it says ‘section header expected‘. So I also uncomment [general] line from svnserve.conf and it works fine.