Monday, 04 January 2010 14:36
Last Updated on Monday, 04 January 2010 17:25
Written by Ron Bassett
Here is a Command Line svn Cheat Sheet. I am adding them as I use them.
Create a Repository
To store projects in Subversion, first you must create a repository. This must be done to a local drive on a local machine. Creating a repository on a network drive is not supported. To create a repository type:
svn create /path/to/repository
-- OR --
svn Import
-----------
Recursively commit a copy of PATH to URL.
svn add
When you add a new file or directory to a project that has been checked out, you must tell Subversion to include that file or directory in its version control.
svn add file_or_dir_name
Adding a directory will add the directory and all the files and directories in it. However, this does not add the file or directory to the repository, you must still issue a commit to update the repository.
--------------
svn commit
Once you have added, deleted, or changed files or directories, you can then commit those changes to the repository. This command is pretty straightforward:
svn commit -m "Saving recent changes" http://localhost/svn_dir/repository/project_dir
-------------
Updating Your Local Files - svn update
svn update
If there are newer files in the repository, they will overwrite any files you have locally. Before using this command, you may want to use the svn diff command to find out what the differences are between your local files and the repository.
svn Checkout
svn checkout URL... [PATH]
Description
Check out a working copy from a repository. If PATH is omitted, the basename of the URL will be used as the destination. If multiple URLs are given each will be checked out into a subdirectory of PATH, with the name of the subdirectory being the basename of the URL.
Example
Check out a working copy into a directory called 'mine':
$ svn checkout file:///tmp/repos/test mine
A mine/a
A mine/b
Checked out revision 2.
$ ls
mine
If you need more information a great reference is http://svnbook.red-bean.com/en/1.0/ch09.html
http://www.abbeyworkshop.com/howto/misc/svn01/