Changes between Version 10 and Version 11 of code/tools/SVN
- Timestamp:
- Feb 18, 2008, 10:13:36 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/tools/SVN
v10 v11 1 1 [[TracNav(TracNav/TOC)]] 2 2 == SVN == 3 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 allowmost flexibilities the bash shell allows.[[br]][[br]]3 This Page 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. Further it is assumed that the user has a basic understanding of the shell, and knows the way around in the file structure. Svn allows most flexibilities the bash shell allows.[[br]][[br]] 4 4 5 these are some examples, which are elaborated further down.5 These are some examples, which are elaborated further down. 6 6 {{{ 7 7 svn co https://svn.orxonox.net/data/trunk data … … 16 16 svn diff 17 17 }}} 18 19 Read the [http://svnbook.red-bean.com/en/1.1/index.html official guide to subversion] or its [http://www.onlamp.com/pub/a/onlamp/2002/10/31/subversion.html shorter version] for further information. 18 20 19 21 If not noted otherwise all commands are recursive. … … 35 37 ---- 36 38 === update (up) === 37 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.39 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. 38 40 39 41 The syntax is ''svn up <local-path>'', if <local-path> is omitted the current update will be allied to the current directory. … … 52 54 ---- 53 55 === commit (ci) === 54 Sometime also called checkin, does the opposite of checkout or update, it upload changes made to the local theto the server.56 Sometimes also called checkin, does the opposite of checkout or update, it upload changes made to the local copy to the server. 55 57 56 58 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. 57 59 58 this will checkin the current directory including subfolders with the comment "initial upload"60 This will checkin the current directory including subfolders with the comment "initial upload" 59 61 {{{ 60 62 svn ci -m "initial upload" 61 63 }}} 62 64 63 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].65 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]. 64 66 ---- 65 67 === add === 66 Adding a new file to the local svn copy, that it get upload with the next commit.68 Adding a new file to the local svn copy, that it gets uploaded with the next commit. 67 69 68 70 The syntax is ''svn add <file>'' 69 71 70 this will add the files myFile.cc and myFile.h in the folder myFolder to the svn72 This will add the files myFile.cc and myFile.h in the folder myFolder to the svn 71 73 {{{ 72 74 svn add myFolder/myFile.cc myFolder/myFile.h … … 74 76 ---- 75 77 === remove (rm) === 76 Also called delete (del), which deletes an item from the svn tree. please note that this also removedthe file/folder from the local harddrive.78 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. 77 79 78 80 The syntax is ''svn rm <file/folder>''. 79 81 80 this will remove the file myOldFile.cc from the svn tree82 This will remove the file myOldFile.cc from the svn tree 81 83 {{{ 82 84 svn rm myOldFile.cc … … 84 86 ---- 85 87 === move (mv) === 86 Sometime called rename (ren) - as a rename is the same as a move. The command simplifies the rearranging of files in the svn tree.88 Sometimes called rename (ren) - as a rename is the same as a move. The command simplifies the rearranging of files in the svn tree. 87 89 88 90 The syntax is ''svn mv <source files> <target-folder>'' 89 91 90 this will move the files myFile.cc and myFile.h to myFolder92 This will move the files myFile.cc and myFile.h to myFolder 91 93 {{{ 92 94 svn mv myFile.cc myFile.h myFolder 93 95 }}} 94 96 95 this will rename the file myFiel.cc to myFile.cc - to correct a typo. please note the mv and rename are the same command97 This will rename the file myFiel.cc to myFile.cc - to correct a typo. Please note the mv and rename are the same command 96 98 {{{ 97 99 svn ren myFiel.cc myfile.cc … … 99 101 ---- 100 102 === copy (cp) === 101 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.103 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. 102 104 103 105 The syntax is ''svn cp <source-tree> <target-tree>'' or ''svn cp <source-files> <target>'' … … 109 111 ---- 110 112 === resolved === 111 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.113 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. 112 114 113 115 The syntax is ''svn resolved <conflicting file>'' … … 119 121 ---- 120 122 === revert === 121 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.123 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. 122 124 123 125 The syntax is ''svn revert <target>''. … … 129 131 ---- 130 132 === diff (di) === 131 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, th ethere are two commits in short time, first the updates, then the new files.133 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. 132 134 133 135 The syntax is ''svn di <local-path>'', if <local-path> is omitted, the current directory is assumed. 134 136 135 this will show - print to the console - the current changes made to the revision137 This will show - print to the console - the current changes made to the revision 136 138 {{{ 137 139 svn di .