Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 33 and Version 34 of code/tools/SVN


Ignore:
Timestamp:
Apr 13, 2017, 12:02:09 AM (7 years ago)
Author:
landauf
Comment:

fixed links and formatting

Legend:

Unmodified
Added
Removed
Modified
  • code/tools/SVN

    v33 v34  
    1616hours and hours of coding. If you screw up in any way, you can always revert to the last working state.
    1717
    18 [[TracNav(TracNav/TOC_Development)]]
    1918
    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'''
    2321
    2422There 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.
     
    2826}}}
    2927
    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 ==
    3329
    3430This 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]]
     
    5450
    5551If not noted otherwise all commands are recursive.
    56 }}}
    5752
    58 {{{
    59 #!div style="background-color: #F7F7F7; border: 1px solid #888888; margin: 5px; padding: 10px;"
    6053
    61 {{{
    62 #!html
    63 <h3 style="margin:0;" id="checkout">checkout (co)</h3>
    64 }}}
     54=== checkout (co) ===
    6555
    6656The checkout command is used to create a local copy of a svn subtree on the local computer.
     
    7767svn co -r 200 https://svn.orxonox.net/game/code/branches/test
    7868}}}
    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
    8572Update 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.
    8673
     
    9885
    9986Updates 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
    10690Sometimes also called checkin, does the opposite of checkout or update, it upload changes made to the local copy to the server.
    10791
     
    11498
    11599A 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
    122103Adding a new file to the local svn copy, that it gets uploaded with the next commit.
    123104
     
    129110svn add myFolder/myFile.cc myFolder/myFile.h
    130111}}}
    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
    137115Also called delete (del), which deletes an item from the svn tree. Please note that this also removes the file/folder from the local harddrive.
    138116
     
    143121svn rm myOldFile.cc
    144122}}}
    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
    151126Sometimes called rename (ren) - as a rename is the same as a move. The command simplifies the rearranging of files in the svn tree.
    152127
     
    162137svn ren myFiel.cc myfile.cc
    163138}}}
    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
    170142A 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.
    171143
     
    176148svn cp https://svn.orxonox.net/game/code/trunk https://svn.orxonox.net/game/code/branches/test
    177149}}}
    178 {{{
    179 #!html
    180 <hr style="margin:0px;">
    181 <br/>
    182 <h3 style="margin:0;" id="resolved">resolved</h3>
    183 }}}
     150
     151=== resolved ===
     152
    184153If 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.
    185154
     
    190159svn resolved myConflictFile.cc
    191160}}}
    192 {{{
    193 #!html
    194 <hr style="margin:0px;">
    195 <br/>
    196 <h3 style="margin:0;" id="revert">revert</h3>
    197 }}}
     161
     162=== revert ===
     163
    198164One 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.
    199165
     
    204170svn revert myFile.cc
    205171}}}
    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
    212175Another 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.
    213176
     
    218181svn di .
    219182}}}
    220 {{{
    221 #!html
    222 <hr style="margin:0px;">
    223 <br/>
    224 <h3 style="margin:0;" id="merge">merge</h3>
    225 }}}
     183
     184=== merge ===
    226185
    227186For those of you, who are courageous enough to merge two branches, or adequate, here's a little description about merge:
     
    239198    patch -p0 < <path-to-patch-file>
    240199}}}
    241 }}}