Version 3 (modified by nicolasc, 17 years ago) (diff) |
---|
SVN
This Page contains a collection of the most used svn command including some examples.
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 cp https://svn.orxonox.net/orxonox/trunk https://svn.orxonox.net/orxonox/branches/test svn diff svn resolve somefile.cc svn revert
If not noted otherwise all commands are recursive.
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 <remote-path> <local-path>, if <local-path> is omitted the last remote folder will be used as <local-path>.
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.
svn co https://svn.orxonox.net/orxonox/branches/test
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 <local-path>, if <local-path> 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 here.
checkin (ci)
sometime also called commit, does the opposite of checkout or update, it upload changes made to the local the to the server. The syntax is svn ci -m <commit message> <local-path>, if <local-path> is omitted, the current directory is assumed, if -m <commit message> 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 checkin 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 update.