How To Create SVN Repository

How to get help with svn?

If you are looking for svn reference in man pages, you have gone to the wrong place. To check the references of svn commands, simple do this:

svn help

This will make svn list all the available functions, to get the function reference, let say checkout

svn help checkout

The same thing goes to other svn related commands, such as svnadmin

svnadmin help

How to create a svn repository?

First of all what is repository? It is a core file for svn, or you can call it a centralized svn backup database. After created it, it is just a directory with its files. IMPORTANT! Do NOT try to modify or add something into the repository, unless you know what are you doing.

To create a svn repo, let say I wanna create a repo to store all my programming codes, I do this

svnadmin create /home/mysurface/repo/programming_repo

Remember try to use absolute path for everything, sometimes the relative path is not going to work.

How to import my existing directories into the new repo?

svn import /home/mysurface/programming file:///home/mysurface/repo/programming_repo -m “Initial import”

-m stand for log message, the first revision was created with log as “Initial import”. You need to specified URL for the repo, URL is the standard argument for svn. Therefore for local file, you need to specified with file://

How to see what is inside the repo?

svn list file:///home/mysurface/repo/programming_repo

Another way of listing all the files and folder in the tree view, I use svnlook

svnlook tree programming_repo

The difference between svn list and svnlook tree is one expect URL another one do not.



Leave a Reply