}}}
There are many SVN clients, the two below are just examples. Of course you can use whatever client you like.
* Windows: [http://tortoisesvn.tigris.org/ TortoiseSVN]
* Linux: [http://rapidsvn.tigris.org/ RapidSVN] (can also be found in your distribution's repository)
{{{
#!html
}}}
This section below contains a collection of the most used svn commands including some examples. This page does not claim to be complete. For further reading use the built-in help function from svn. The syntax is ''svn help '', if command is omitted, a complete list of valid svn command in printed to the comsole. Furthermore it is assumed that the user has a basic understanding of the shell and knows the way around in the file structure. Svn allows for most of the flexibilities the bash shell allow.[[br]][[br]]
These are some examples, which are elaborated further down.
{{{
#!html
svn co https://svn.orxonox.net/data/trunk data
svn up
svn ci -m "some message"
svn add myFile.cc myFile.h
svn rm trash-folder
svn mv myFile.cc myFile.h myFolder
svn cp https://svn.orxonox.net/orxonox/trunk https://svn.orxonox.net/orxonox/branches/test
svn resolved somefile.cc
svn revert
svn diff
}}}
Read the [http://svnbook.red-bean.com/en/1.5/index.html official guide to subversion] for further information.
If not noted otherwise all commands are recursive.
{{{
#!html
checkout (co)
}}}
The checkout command is used to create a local copy of a svn subtree on the local computer.
The syntax used is ''svn co -r '', if -r is omitted, the HEAD revision is assumed, which is also the newest one, if is omitted the last remote folder will be used as .
This will create a folder orxonox-trunk with the contents of the trunk
{{{
svn co https://svn.orxonox.net/orxonox/trunk orxonox-trunk
}}}
This will create a folder called test, with the content of the test branch at revision 200.
{{{
svn co -r 200 https://svn.orxonox.net/orxonox/branches/test
}}}
{{{
#!html
update (up)
}}}
Update is closely related to checkout, as it also download - or updates - the svn tree. while checkout is normally only used once, update is used all the time.
The syntax is ''svn up '', if is omitted the current update will be allied to the current directory.
This will update the current folder including subfolders.
{{{
svn up
}}}
This will update the trunk and the test-branch.
{{{
svn up trunk branches/test
}}}
Updates may cause conflicts if the remote and local file has been changed in the same place. to resolve a conflict see [wiki:SVN#resolved here].
{{{
#!html
commit (ci)
}}}
Sometimes also called checkin, does the opposite of checkout or update, it upload changes made to the local copy to the server.
The syntax is ''svn ci -m '', if is omitted, the current directory is assumed, if -m is ommited, an editor will pop up where you can (and should) write a meaningful commit message.
This will checkin the current directory including subfolders with the comment "initial upload"
{{{
svn ci -m "initial upload"
}}}
A commit is only possible if the local version is up-to-date. If it isn't you will get an error, and the commit will fail. The solution then is to do an [wiki:SVN#updateup update].
{{{
#!html
add
}}}
Adding a new file to the local svn copy, that it gets uploaded with the next commit.
The syntax is ''svn add ''
This will add the files myFile.cc and myFile.h in the folder myFolder to the svn
{{{
svn add myFolder/myFile.cc myFolder/myFile.h
}}}
{{{
#!html
remove (rm)
}}}
Also called delete (del), which deletes an item from the svn tree. Please note that this also removes the file/folder from the local harddrive.
The syntax is ''svn rm ''.
This will remove the file myOldFile.cc from the svn tree
{{{
svn rm myOldFile.cc
}}}
{{{
#!html
move (mv)
}}}
Sometimes called rename (ren) - as a rename is the same as a move. The command simplifies the rearranging of files in the svn tree.
The syntax is ''svn mv