SVN Subversion:: Quick CheatSheet

PDF download of SVN Subversion:: Quick CheatSheet (pdf download) 2009-09-15 09:32:06

I have been asked by so many people for a quick reference cheatsheet for SVN Subversion for the command line. So here I go, below are the most commonly used SVN commands on the command line.

# svn checkout/co #
# notes...
# checkout = co
# [project] is optional, if not used svn will create a folder using the project name in the repository
> svn checkout http://svn.jaoudestudios.com/project [project]
# or
> svn co http://svn.jaoudestudios.com/project [project]
# example
> svn co http://svn.jaoudestudios.com/project project_name

# svn update/up #
# notes...
# update = up
# [-r xxx] is optional, if not used the latest and greatest revision will be used. (xxx is any revision number)
# [files/folders] is optional, if not used will update for the current folder & sub-folders, otherwise will only update for specified file/directory
# it is also possible to increase to a later revision as well as decreasing to a previous one
> svn update [-r xxx] [file/folder]
# or
> svn up [-r xxx] [file/folder]
# or to specify a specific revision number
> svn update -r xxx
# or
> svn up -r xxx
# examples
> svn up -r 1045
> svn up -r 1045 public/

# svn status #
# this will list all the changed/modified files in your working copy.
# Important...If you are a tester this should always display nothing!
> svn status

# svn commit #
# notes...
# [files/folders] is optional, if not used all modified files are commited
# wild flags can be used, for example public/*
> svn commit -m "Comments go here" [files/folders]
# examples
> svn commit -m "My Comments"
> svn commit -m "My Comments" public/index.php
> svn commit -m "My Comments" public/*

# svn add/delete #
# notes...
# wild flags can be used, for example public/*
> svn add [files/folders]
> svn delete [files/folders]
# examples
> svn add filename
> svn delete filename
# wild flag example
> svn add public/*
> svn delete public/*

# svn mkdir/mv #
> svn mkdir folder_name
> svn mv filename1 filename2

# svn log #
# notes...
# [-r xxx:xxx] is optional, if not used will display the complete log history from revision 1, otherwise for the range specified
# [files/folders] is optional, if not used will display log for the current folder & sub-folders, otherwise will only display for specified file/directory
> svn log [-r xxx:xxx] [files/folders]
# examples
> svn log
> svn log -r 1054:950
> svn log -r HEAD:950
> svn log -r HEAD:950 public/


If anyone would like anymore examples or commands let me know and I will update the SVN subversion cheatsheet

Coolis

What about differences between working copy and the repository?

Could you please add more information & examples on this?

Thanks :)

SVN Subversion:: Quick CheatSheet

Eddie Jaoude

Sure.

# this will do a diff between the local working copy and the repo
> svn diff [filename]

NB: more to follow shortly

http://www.jaoudestudios.com
SVN Subversion:: Quick CheatSheet