Using SVN - Installation

This is the part I of the Subversion series.

Here are some simple steps for creating the SVN to work under CentOS 5.2:

// Step 1 – Install the SVN
yum install subversion

// Step 2 – Create the central directory for holding all subversion repositories
mkdr /workplace/svn

// Step 3 – Create the svn repository cv in /workplace/svn
svnadmin create /workplace/svn/cv

// Step 4 – Change to the directory where files are going to add to the cv repo
cd /home/gene/cv

// Step 5 – Do the initial import to the cv repo
svn import -m “initial import” .  file:///workplace/svn/cv

That’s all we need to create the the SVN repository.  Now we may want to check it out and have some fun with it.

Check out
// Case #1 –  Check out the cv repo to the same machine
mkdir /tmp/checkout
cd /tmp/checkout
svn checkout file:///workplace/svn/cv

// Case #2 – Check out the cv repo at remote machine using ssh
mkdir /tmp/checkout
cd /tmp/checkout
svn co svn+ssh://gene@gl818.net/workplace/svn/cv

Note:

  1. checkout = co
  2. It would be better to create a group that has read/write permission to the repository and assign ssh users to the group.
  3. Follow this link to set up SSH connection without password authentication.

Adding files or directories to the repo

svn add test.txt
svn commit -m “Added file ‘test.txt’.”

Remove files from the repo

svn del test.txt
svn commit -m “Deleted file ‘test.txt’.”

Some useful commands

svn list — List directory entries in the repository.
svn move — Move a file or directory.
svn propdel — Remove a property from an item.
svn proplist — List all properties.
svn propset — Set PROPNAME to PROPVAL on files, directories, or revisions.
svn status — Print the status of working copy files and directories.
svn update — Update your working copy.


References

http://svnbook.red-bean.com/nightly/en/svn-book.html