| 1 | = Howto of how to use SVN = |
| 2 | |
| 3 | ^Because of the mass of bad and ugly Howto's of SVN found on the internet, and for the users of my SVN repository... i decided to write my own Howto^ |
| 4 | [[BR]] |
| 5 | [[BR]] |
| 6 | == Basic Usage == |
| 7 | * First of all, install '''SVN''' ( ''subversion'' package ) |
| 8 | * Obtain a list of the possible projects to download from a SVN repository: |
| 9 | {{{ |
| 10 | svn list --verbose svn://thanatermesis.org |
| 11 | }}} |
| 12 | * Download the sources of a project: |
| 13 | {{{ |
| 14 | svn co svn://thanatermesis.org/test1 destdir |
| 15 | }}} |
| 16 | * ,,We can use '''test1''' for this example,, |
| 17 | * ,, ''' svn co ''' is the same as ''' svn checkout ''' ,, |
| 18 | |
| 19 | * Update a project downloading the last possible version: |
| 20 | {{{ |
| 21 | svn update |
| 22 | }}} |
| 23 | |
| 24 | [[BR]] |
| 25 | == For developers == |
| 26 | |
| 27 | * See the differences within the repository |
| 28 | {{{ |
| 29 | svn diff |
| 30 | }}} |
| 31 | * Send modifications of the files or ''commit'' |
| 32 | {{{ |
| 33 | svn commit -m 'Fixed the bug of double interfaces launched' |
| 34 | svn commit evidence-gui* -m 'Commiting the evidence-gui files' |
| 35 | }}} |
| 36 | * ,,You need to add a comment with the '''-m''' option, it's important that you provide a good description in order to better understand the steps of the code, and browse better old versions and old modifications,, |
| 37 | |
| 38 | * Upload it in the next commit |
| 39 | {{{ |
| 40 | svn add file |
| 41 | svn add directory |
| 42 | svn add images/*.png |
| 43 | }}} |
| 44 | * Delete files |
| 45 | {{{ |
| 46 | svn delete file |
| 47 | svn delete images/ |
| 48 | svn delete test*.c |
| 49 | }}} |
| 50 | |
| 51 | * Move files |
| 52 | {{{ |
| 53 | mkdir data |
| 54 | svn move images data/images |
| 55 | }}} |
| 56 | |
| 57 | * Revert modifications ( '' Revert modifications to a file, don't need connection, but it won't recover a deleted directory '' ) |
| 58 | {{{ |
| 59 | svn revert file |
| 60 | svn revert directory |
| 61 | }}} |
| 62 | |
| 63 | * Verify the status of the repository and your working environment |
| 64 | {{{ |
| 65 | svn status |
| 66 | }}} |
| 67 | |
| 68 | * Fix your changes with another persons changes ( ^When you have worked in this file, another person has worked also, and there are differences between the new changes, you need to fix your code with the new commit of this person^ ) |
| 69 | {{{ |
| 70 | ---> This section need to be edited, i don't know how to make this <--- |
| 71 | svn status |
| 72 | svn help merge |
| 73 | svn help resolved |
| 74 | }}} |
| 75 | |
| 76 | ||U||Updated file, changes made on the server|| |
| 77 | ||A||Added, file added to the copy of work|| |
| 78 | ||D||Deleted, file deleted from the copy of work|| |
| 79 | ||R||Replaced, (deleted and added again, normally diferent file)|| |
| 80 | ||G||!MerGed, the file from your copy of work and the repository has changed, but added successfully|| |
| 81 | ||C||Conflicting, the file downloaded has diferences with your file, you need to fix it manually|| |
| 82 | |
| 83 | [[BR]] |
| 84 | == For Administrators and Servers == |
| 85 | |
| 86 | How to make a SVN server: |
| 87 | * Verify if you have the '''svnserve''' command |
| 88 | * Create a SVN repository ( ^we use in this example '''svnrepo''' in a home of a user created only for this^ ) |
| 89 | {{{ |
| 90 | su svndevels |
| 91 | cd /home/svndevels |
| 92 | svnadmin create svnrepo |
| 93 | }}} |
| 94 | * Edit the '''/etc/inetd.conf''' file and add this line: |
| 95 | {{{ |
| 96 | svn stream tcp nowait svndevels /usr/bin/svnserve svnserve -i -r /home/svndevels/svnrepo |
| 97 | }}} |
| 98 | * We have added ''-r /home/svndevels/svnrepo'' for when you check the repository from internet, you don't need to enter all ''/home/svndevels/svnrepo'' address, you have the repository directly from the simple host address |
| 99 | |
| 100 | * Create a new directory project |
| 101 | {{{ |
| 102 | svn mkdir file:///home/svndevels/svnrepo/project1 -m 'Creation of the directory' |
| 103 | }}} |
| 104 | * Import the source code of a project on it |
| 105 | {{{ |
| 106 | svn import /home/svndevels/sourcecodes/source-evidence file:///home/svndevels/svnrepo/project1 -m 'Importing the sources of evidence to project-1' |
| 107 | }}} |
| 108 | * Add users and give access to the repository ('''Important''' step for external connections) |
| 109 | * Edit the configurations file |
| 110 | {{{ |
| 111 | vi svnrepo/conf/svnserve.conf |
| 112 | }}} |
| 113 | * Un-comment the lines of need configuration for give a similar look: |
| 114 | {{{ |
| 115 | |
| 116 | [general] |
| 117 | anon-access = read |
| 118 | auth-access = write |
| 119 | password-db = passwd |
| 120 | }}} |
| 121 | * ''Important to not have spaces before the first character'' |
| 122 | * Access type: read, write, none |
| 123 | * Where: |
| 124 | * ''anon-access'' '''is the''' access type of the non-identified users |
| 125 | * ''auth-access'' '''is the''' access type for the identified users |
| 126 | * ''password-db'' '''is the''' name of the file of contains the users and passwords |
| 127 | |
| 128 | * Now we edit the passwd file |
| 129 | {{{ |
| 130 | vi svnrepo/conf/svnserve.conf |
| 131 | }}} |
| 132 | {{{ |
| 133 | [users] |
| 134 | testuser = passme |
| 135 | }}} |
| 136 | * Restart the inetd service now with root |
| 137 | {{{ |
| 138 | /etc/init.d/inetd restart |
| 139 | }}} |
| 140 | * Redirect the port 3690 in TCP mode to your machine ( ''You can posible to use apache configuration, manage more easy diferents users and use the port 80 and accessing by '''http''' address, but this is not described in this howto '' ) |
| 141 | |
| 142 | * Verify if the server works |
| 143 | {{{ |
| 144 | svn list --verbose svn://domain |
| 145 | }}} |
| 146 | * I recomend to create a "test" project for make any test before to work directly on the real project |
| 147 | |
| 148 | [[BR]] |
| 149 | |
| 150 | == More information about SVN == |
| 151 | |
| 152 | The better documentation of SVN is in any case, the '''[http://svnbook.org/ Book of SVN]''', all things are described on this book with good sections, you learn and found really more fast with this book than using howto's found in internet, from my experience, i don't have found any real good howto about SVN in google and the only thing of i have done, is lost 4 hours for not obtain any thing |
| 153 | |
| 154 | The http://www.debian-administration.org website is very good, you can found a related article on http://www.debian-administration.org/articles/374 |
| 155 | |
| 156 | |
| 157 | [[BR]] |