SVN+SSH Tutorial
IIIT- Bangalore DB 101/2010
Installing client software
$ sudo apt-get install subversion
Initializing the repository
On the server, use the svnadmin tool to create a new repository:
$ svnadmin create $HOME/my-repo
This command would create a new repository structure under ~/my-repo.
Generating a working copy
On your workstation, use the svn import command to create a working copy of the repository:
$ mkdir my-files
$ svn import -m "My files" my-files \
svn+ssh://my-username@my-server/my-home/my-repo
$ rm -rf my-files
$ svn checkout svn+ssh://my-username@my-server/my-home/my-repo/my-files
TortoiseSVN users can generate a working copy by right-clicking on an empty directory, selecting
the SVN Checkout... command and entering the URL of the repository in the dialog.
Examples
$ mkdir my-website
$ cd my-website
# See the local modifications to text files since the last commit.
$ svn diff |more
$ svn diff |vim -
# Merge changes committed to the repository since last update/checkout.
$ svn up
# Add an existing directory and all the files it contains.
$ svn add old-images/
# Create an empty directory.
$ svn mkdir new-images/
# Remove a file or directory.
$ svn remove [Link]
# Rename a file or directory on the repository.
$ svn move file1 file2
$ svn move dir1/ dir2/
# Display the history information for a file or directory.
$ svn log images
#
# Commit changes to the working copy into the repository. Unless the
# commit message is given on the command line with "-m", it will bring
# up your text editor ($EDITOR).
#
$ svn commit
$ svn commit -m 'Summary of changes'
Links
• Subversion Home
• The Subversion Book
• The Subversion Commands
• Details of SSH authentication
• TortoiseSVN, GUI client for Windows