Changes between Version 33 and Version 34 of code/tools/SVN
- Timestamp:
- Apr 13, 2017, 12:02:09 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/tools/SVN
v33 v34 16 16 hours and hours of coding. If you screw up in any way, you can always revert to the last working state. 17 17 18 [[TracNav(TracNav/TOC_Development)]]19 18 20 {{{ 21 #!div style="background-color: #FFFFDD; border: 3px solid #000000; margin: 5px; padding: 10px; width: 710px;" 22 [[span('''SVN Clients''', style=font-family: sans-serif; font-size: 16px)]] 19 {{{#!box tips 20 '''SVN Clients''' 23 21 24 22 There are many SVN clients, the two below are just examples. Of course you can use whatever client you like. A client with a graphical user interface however might protect you from mistakes due to mistyped commands. … … 28 26 }}} 29 27 30 {{{ 31 #!div style="background-color: #F4F4FF; border: 3px solid #000000; margin: 5px; padding: 10px; width: 710px;" 32 [[span('''SVN Command Description''', style=font-family: sans-serif; font-size: 16px)]] 28 == SVN Command Description == 33 29 34 30 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 <command>'', 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]] … … 54 50 55 51 If not noted otherwise all commands are recursive. 56 }}}57 52 58 {{{59 #!div style="background-color: #F7F7F7; border: 1px solid #888888; margin: 5px; padding: 10px;"60 53 61 {{{ 62 #!html 63 <h3 style="margin:0;" id="checkout">checkout (co)</h3> 64 }}} 54 === checkout (co) === 65 55 66 56 The checkout command is used to create a local copy of a svn subtree on the local computer. … … 77 67 svn co -r 200 https://svn.orxonox.net/game/code/branches/test 78 68 }}} 79 {{{ 80 #!html 81 <hr style="margin:0px;"> 82 <br/> 83 <h3 style="margin:0;" id="update">update (up)</h3> 84 }}} 69 70 === update (up) === 71 85 72 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. 86 73 … … 98 85 99 86 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]. 100 {{{ 101 #!html 102 <hr style="margin:0px;"> 103 <br/> 104 <h3 style="margin:0;" id="commit">commit (ci)</h3> 105 }}} 87 88 === commit (ci) === 89 106 90 Sometimes also called checkin, does the opposite of checkout or update, it upload changes made to the local copy to the server. 107 91 … … 114 98 115 99 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#update update]. 116 {{{ 117 #!html 118 <hr style="margin:0px;"> 119 <br/> 120 <h3 style="margin:0;" id="add">add</h3> 121 }}} 100 101 === add === 102 122 103 Adding a new file to the local svn copy, that it gets uploaded with the next commit. 123 104 … … 129 110 svn add myFolder/myFile.cc myFolder/myFile.h 130 111 }}} 131 {{{ 132 #!html 133 <hr style="margin:0px;"> 134 <br/> 135 <h3 style="margin:0;" id="remove">remove (rm)</h3> 136 }}} 112 113 === remove (rm) === 114 137 115 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. 138 116 … … 143 121 svn rm myOldFile.cc 144 122 }}} 145 {{{ 146 #!html 147 <hr style="margin:0px;"> 148 <br/> 149 <h3 style="margin:0;" id="move">move (mv)</h3> 150 }}} 123 124 === move (mv) === 125 151 126 Sometimes called rename (ren) - as a rename is the same as a move. The command simplifies the rearranging of files in the svn tree. 152 127 … … 162 137 svn ren myFiel.cc myfile.cc 163 138 }}} 164 {{{ 165 #!html 166 <hr style="margin:0px;"> 167 <br/> 168 <h3 style="margin:0;" id="copy">copy (cp)</h3> 169 }}} 139 140 === copy (cp) === 141 170 142 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. 171 143 … … 176 148 svn cp https://svn.orxonox.net/game/code/trunk https://svn.orxonox.net/game/code/branches/test 177 149 }}} 178 {{{ 179 #!html 180 <hr style="margin:0px;"> 181 <br/> 182 <h3 style="margin:0;" id="resolved">resolved</h3> 183 }}} 150 151 === resolved === 152 184 153 If a conflict arises - this normally happens if someone changes 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. To resolve the conflict use a diff tool to look at and edit the different versions next to each other. On Tardis we suggest {{{meld}}}, which even allows three way comparisons. 185 154 … … 190 159 svn resolved myConflictFile.cc 191 160 }}} 192 {{{ 193 #!html 194 <hr style="margin:0px;"> 195 <br/> 196 <h3 style="margin:0;" id="revert">revert</h3> 197 }}} 161 162 === revert === 163 198 164 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. 199 165 … … 204 170 svn revert myFile.cc 205 171 }}} 206 {{{ 207 #!html 208 <hr style="margin:0px;"> 209 <br/> 210 <h3 style="margin:0;" id="diff">diff (di)</h3> 211 }}} 172 173 === diff (di) === 174 212 175 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, that there are two commits in short time, first the updates, then the new files. 213 176 … … 218 181 svn di . 219 182 }}} 220 {{{ 221 #!html 222 <hr style="margin:0px;"> 223 <br/> 224 <h3 style="margin:0;" id="merge">merge</h3> 225 }}} 183 184 === merge === 226 185 227 186 For those of you, who are courageous enough to merge two branches, or adequate, here's a little description about merge: … … 239 198 patch -p0 < <path-to-patch-file> 240 199 }}} 241 }}}