SVN is a client-server application where the SVN repository serves the tasks of a server. It is a central storage place which stores information in the form of a filesystem tree. Users share data by reading and writing to the repository. The repository keeps track of all changes written to the file i.e. modifications to the files, file contents, and directory structure. Users see the latest version of the filesystem by default but they can view every change ever make to the contents of the repository.
Accessing SVN repository
SVN repositories can be accessed in many different ways based on how it is configured by the administrator. Note that SVN is a client-server application and as such the repository location is always a URL. Following are different methods to access the repository:
file:// repository is on local disk
http:// access through WebDAV protocol and Apache server
https:// access through WebDAV protocol and Apache server with SSL encryption
svn:// svnserve server
svn+ssh:// svn:// through SSH tunnel
SVN Repository Layout
User can structure the SVN repository any way he wants but following is the recommended layout
cd ~ $ svnadmin create svnrespos $ svn mkdir file:///home/me/svnrepos/trunk \ file:///home/me/svnrepos/branches \ file:///home/me/svnrepos/tags \ -m "creating repository layout" $ svn list file:///home/me/svnrepos /trunk /branches /tags
The main development goes into the trunk. Branch development copies go in branches. Tag copies go into tags directory.
Getting data into SVN repository
User can copy data to the repository using either svn import or svn add commands. svn import is used to import files from a directory which is not a local working copy.
$ svn import my_directory file:///home/me/svnrepos/trunk -m "importing ..."
To add a file using svn add, first create a file x.txt with an editor of you choice inside you local working copy. Then run the following command.
$ svn add myfile
Now SVN can recognize this as a file related to the project. Next commit it to the repository
$ svn commit file:///home/me/svnrepos/trunk