Skip directly to content

SVN Cheatsheet

on Fri, 04/09/2010 - 07:48

This cheatsheet is a quick reference for using SVN,

Create a Repository on Linux: svnadmin create

 To store projects in Subversion/SVN, first you must create a repository.

svnadmin create /svnrepos

Add a Project to Repository - svn Import

 svn import -m "import project" /home/xxxx/public_html file:///svnrepos/<project name>

Starting SVN Server daemon- svnserve

svnserve -d

This would start the SVN daemon on port 3690. To listen to port other than 3690

svnserve -d --listen-port=8080

Checking Out a Project - svn co

 svn co svn://<server>/svnrepos/<project name>

svn co stands for svn checkout.

Checking for Changes - svn status

To see what files you have changed or added to your checked out work, use svn status:

 svn status 

Adding new files - svn add

svn add <file or dir name>

SVN Add Recursively

svn status | grep "^\?" | awk '{print $2}' | xargs svn add

SVN Delete - svn delete

svn delete <file or dir name>

SVN update - svn update

svn update 

SVN Commit - svn commmit

svn commit <file or dir name>

You can also use,

svn ci <file or dir name>

SVN Tagging Project

svn copy  -m "Tagging the 1.0 release of the project" svn://server-name/svnrepos/project/trunk svn://server-name/svnrepos/project/tags/1.0 

excluding file types

Excluding file types methond is missing. I think it is also important to know. Leaving out images, cache files and so on.

SVN Add Recursively

svn add * --force

Update: To learn about the error SVN add "already under version control",