- Code: Select all
$ sudo apt-get install subversion
2. You need to create an svn repository location which basically is a directory path where all your projects will reside. The first command below creates that location in /home/svn, then you navigate into that directory after which you issue the svnadmin create command. The svnadmin create command both creates a directory (project1, project2, project3) where the content of your project or application will be stored and also initializes those directories as an svn directory.
Issuing the following commands achieves just that.
Please Note that the location and naming convention of the directory names is up to you.
- Code: Select all
$ sudo mkdir /home/svn
$ cd /home/svn
- Code: Select all
$ sudo svnadmin create /home/svn/project1
$ sudo svnadmin create /home/svn/project2
$ sudo svnadmin create /home/svn/project3
3. Importing Files into your repository: This command will recursively import files and directories into your project repository. These files will then be available for checkout (co) in step 4
- Code: Select all
svn import -m "Commit Comment" /path/to/import/directory file:///path/to/repos/project
- Code: Select all
sudo svn import -m "Imported Files into Rails Project" /home/joshua/Desktop/railsappopensource/ file:///svn/repositories/railsapp/
4. Repository access methods.
There are couple of ways to access an svn repository by using any of the following protocols (file://, http://, https://, svn://, svn+ssh://)
I. Using the file:// access method: The file:// access method is enabled by default, so doing something like
- Code: Select all
$ svn co file:///home/svn/project1 /home/joshua/workspace/project1
or
- Code: Select all
svn co file://localhost/home/svn/project1 /home/joshua/workspace/project1
will checkout (copy) the content of the project1 into your workspace. Your workspace is a directory path location created by you where all your development or changes resides until it is checked-in or committed into your project repository.
II. Using the http:// access method: This allows access via WebDAV protocol to Subversion-aware Apache 2 web server. In this case you have to install and configure configure apache webserver. Using this access method you can browse and view the contents of your project files using a browser
I have published another topic on Apache and Subversion Integration and Access Methods using xampp. You can check it out.