| Worry free development: An SVN tutorial for single developers |
| Sunday, 19 July 2009 21:50 |
|
Page 2 of 2 Working with SVNOnce you settled on a sub structure for your repository (and I sincerely hope you opt to use the standard trunk/tags/branches) you need to upload your current source code to the trunk (or equivalent). This is done at the client machine using TortoiseSVN. TortoiseSVN is a shell extension - that is to say, all of its functionality is accessed via File Explorer. To do this, you simply need to right click on your project directory, select TortoiseSvn -> Import and set the URL to: https://[server-ip]:8443/svn/[repository-name]/trunk This will effectively upload your source code (and any files that are not filtered out) to the repository's trunk. Note that you should clean up your project from all intermediate files before you import, as there is no requirement to version/backup these files. Your source code is now compressed inside the repository, waiting to receive updates. For reasons beyond me, importing the source code does not actually link your local code with that of the just uploaded repository. You must do this manually by creating a working copy. A working copy is the copy of the code on your local hard drive.Yes, you just imported the source and therefore it must already be on your drive, but you still need to perform this step. Right click on a directory you want your working copy to reside in (usually, it will be where your original non-source controlled version was located - so you will probably need to move that somewhere - you can even safely delete it) and select TortoiseSVN -> Checkout. Select the same URL you imported to (ending with trunk) and watch how the source is copied from the repository. You will see that the new working copy has some green icons next to each file name and directory ( This is where the magic happens - every time you go about changing your code, simply commit the changes to the project. At this point you are safe to change your code knowing that the code is safely versioned in the repository. Reverting changes and viewing differencesShould you decide that you would like to revert your changes you can do this by Right clicking on the file (or files) you want to revert and either:
Summary: Using SVN, from scratch
For further reading, see the fantastically written TortoiseSVN help file.
|
). This indicates that the file is up-to-date with the file in the repository. Go ahead and modify a file - you will see that it's icon has changed to red (
). If you would like to commit this file (that is, upload the changes you just made to the repository), you can right click on it and select TortoiseSVN -> Commit. Better yet, you can right click on the project directory and select Commit - all modified files will be sent to the repository. Remember that committing changes does not override the repository contents - the repository will always remember the state of the files at any previous state. In the previous example, we would have two versions of the modified file: the first, initial version which was created when we imported the project and a second version which we just created by committing our changes. At any time we can revert to either of these versions, regardless of how many commits we perform on this file.
Comments
Have you tried JVCS, for Delphi it is perfect !
Best