Changes between Version 7 and Version 8 of code/tools/SVN
- Timestamp:
- Feb 18, 2008, 12:30:31 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/tools/SVN
v7 v8 1 1 == SVN == 2 This Page contains a collection of the most used svn command 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 <command>'', of command is omitted, a complete list of valid svn command in printed to the comsole. Further it is assumed that the user has a basic understanding of the shell, and know he way around in the file structure. svn allow most flexibilities the bash shell allows.[[br]][[br]]2 This Page contains a collection of the most used svn command 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 <command>'', of command is omitted, a complete list of valid svn command in printed to the comsole. Further it is assumed that the user has a basic understanding of the shell, and know he way around in the file structure. svn allow most flexibilities the bash shell allows.[[br]][[br]] 3 3 4 4 these are some examples, which are elaborated further down. … … 19 19 20 20 === checkout (co) === 21 the checkout command is used to create a local copy of a svn subtree on the local computer.21 The checkout command is used to create a local copy of a svn subtree on the local computer. 22 22 23 the syntax used is ''svn co -r <revision> <remote-path> <local-path>'', if -r <revision> is omitted, the HEAD revision is assumed, which is also the newest one, if <local-path> is omitted the last remote folder will be used as <local-path>.23 The syntax used is ''svn co -r <revision> <remote-path> <local-path>'', if -r <revision> is omitted, the HEAD revision is assumed, which is also the newest one, if <local-path> is omitted the last remote folder will be used as <local-path>. 24 24 25 25 This will create a folder orxonox-trunk with the contents of the trunk … … 34 34 35 35 === update (up) === 36 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. 36 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. 37 38 The syntax is ''svn up <local-path>'', if <local-path> is omitted the current update will be allied to the current directory. 37 39 38 40 This will update the current folder including subfolders. … … 49 51 50 52 === commit (ci) === 51 sometime also called checkin, 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. 53 Sometime also called checkin, does the opposite of checkout or update, it upload changes made to the local the to the server. 54 55 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. 52 56 53 57 this will checkin the current directory including subfolders with the comment "initial upload" … … 59 63 60 64 === add === 61 adding a new file to the local svn copy, that it get upload with the next commit. the syntax is ''svn add <file>'' 65 Adding a new file to the local svn copy, that it get upload with the next commit. 66 67 The syntax is ''svn add <file>'' 62 68 63 69 this will add the files myFile.cc and myFile.h in the folder myFolder to the svn … … 67 73 68 74 === remove (rm) === 69 also called delete, which deletes an item from the svn tree. please note that this also removed the file/folder from the local harddrive. the syntax is ''svn rm <file/folder>''. you still need to commit it to the server. 75 Also called delete (del), which deletes an item from the svn tree. please note that this also removed the file/folder from the local harddrive. 76 77 The syntax is ''svn rm <file/folder>''. 70 78 71 79 this will remove the file myOldFile.cc from the svn tree … … 75 83 76 84 === move (mv) === 77 sometime 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 <source files> <target-folder>'' 85 Sometime called rename (ren) - as a rename is the same as a move. The command simplifies the rearranging of files in the svn tree. 86 87 The syntax is ''svn mv <source files> <target-folder>'' 78 88 79 89 this will move the files myFile.cc and myFile.h to myFolder … … 88 98 89 99 === copy (cp) === 90 acommand which is rarely used on the local tree - why would someone need a file twice in the same tree? - but it is rather useful to create new branches. though it is normally done by the supervisors, it can be done by the students.100 A command which is rarely used on the local tree - why would someone need a file twice in the same tree? - but it is rather useful to create new branches. though it is normally done by the supervisors, it can be done by the students. 91 101 92 this will create a new branch called test from the current version of the trunk 102 The syntax is ''svn cp <source-tree> <target-tree>'' or ''svn cp <source-files> <target>'' 103 104 This will create a new branch called test from the current version of the trunk 93 105 {{{ 94 106 svn cp https://svn.orxonox.net/orxonox/trunk https://svn.orxonox.net/orxonox/branches/test … … 96 108 97 109 === resolved === 98 if a conflict arises - this normally happens if someone change a file on the server (committed it) while you were doing changes in the same place. This command '''does not solve''' the conflict, but it removes the other unnecessary files.110 If a conflict arises - this normally happens if someone change a file on the server (committed it) while you were doing changes in the same place. This command '''does not solve''' the conflict, but it removes the other unnecessary files. 99 111 100 this will resolve the conflict in in myConflictFile.cc, and make the copy committable again. 112 The syntax is ''svn resolved <conflicting file>'' 113 114 This will resolve the conflict in in myConflictFile.cc, and make the copy committable again. 101 115 {{{ 102 116 svn resolved myConflictFile.cc … … 106 120 One of the major advantages of a version control system, is that you can always revert to a known saved state - in this case the last updated local revision. revert removes all local changes and restores the file to a state prior editing, i.e discarding all local changes. 107 121 108 this will discard all local changes made to myFile.cc 122 The syntax is ''svn revert <target>''. 123 124 This will discard all local changes made to myFile.cc 109 125 {{{ 110 126 svn revert myFile.cc … … 112 128 113 129 === diff (di) === 114 another rarely used but very useful command. it shows you the difference between the downloaded revision and the current state, which basically what will be uploaded at the next commit. It is also useful to check if all new files have been added to the svn tree - it happens very often, the there are two commits in short time, first the updates, then the new files. the syntax is ''svn di <local-path>'', if <local-path> is omitted, the current directory is assumed. 130 Another rarely used but very useful command. It shows the difference between the downloaded revision and the current state, which basically what will be uploaded at the next commit. It is also useful to check if all new files have been added to the svn tree - it happens very often, the there are two commits in short time, first the updates, then the new files. 131 132 The syntax is ''svn di <local-path>'', if <local-path> is omitted, the current directory is assumed. 115 133 116 134 this will show - print to the console - the current changes made to the revision