Notes on how to install SVN and Tortoise
--------------------------------------------
Create a new SVN Repository
---------------------------
1/ Install Tortoise you can find it here
https://tortoisesvn.net/2/ create an empty folder where you want to store your repository
eg. C:\Users\simon\Documents\SVNRepository
3/ open the folder and right click and select TortoiseSVN/Create Repositry here
4/ Click the button that says "Create Folder Structure"
5/ When that completes Click the other button that says "StartReprobrowser"
6/ A window will pop up showing a folder tree of what is in the repository. Nothing but the main folders
'branches', 'tags' and 'trunk' at this stage
7/ in the right hand box right click on trunk and click "Add Folder"
8/ Navigate to the project you want to save in the repository and press button "Select Folder"
9/ The Log Message box pops up so enter a message explaining why you added the folder and click OK, Or just click OK
Check out a project
-------------------
You have now created an SVN repository
Before you can use SVN to keep track of your project progress you need to check out the project.
1/Create a new folder to work n, open it in explorer and right click in it.
eg. C:\Users\simonr\Documents\Work\ProjectName
This is known as your "working copy".
2/ click on SVN Checkout and a checkout dialogue will pop up.
3/ This is the least intuitive part of the process. we need to point Tortoise at the repository.
In the URL of Repository box type the path of the folder that contains your newly created repository.
But with file:// at the begininning
eg. file://C:\Users\simonr\Documents\SVNRepository
don't be tempted to clik the "..." button it won't help you yet.
4/ In the other box "checkout Directory" put the path of the folder where you are going to work
E.g C:\Users\simonr\Documents\Work\ProjectName
5/ click OK
You now have a copy of your original project in the new folder.
Only its slightly different.
It has hidden files which keep track of your changes and all of the file icons now have a tick in a green circle on top of them.
From now on when you change a file the green circle will turn red indicating a change.
When you check a project back in the circle will go green again.
Now you are ready to do some work.
----------------------------------
1/Open your project from the new folder and make some changes and save them as normal
2/open explorer in the folder above your project and right click on it.
3/ Select "SVN Commit..." and a commit dialogue pops up
Type a message explaining what you changed. Always a good idea because you will forget.
4/ Click OK. A progress window will pop up showing the changes being written to the repository.
SVN will automatically give the commit a version number which will be the last thing in the window.
5/ click OK to complete.
6/ make some more changes and commit again.
7/ repeat
Now you have some history you can do some cool things.
List what changes you made in each version
------------------------------------------
1/ Right click on your project working directory
2/ click "TortoiseSVN/show Log"
3/ A log window will pop up showing every commit you made, what version number it is and the commit message telling you what you changed.
if you right click on any line you get a menu giving you a whole load of things you can do including check out an old version.
Check out an old version of the project
---------------------------------------
1/Open the SVN Log as in the above instructions
2/ right click on the version of the project you want to check out
in the checkout window point the checkout directory box to a folder where you want the code to go.
click OK
Create a project Branch
-----------------------
This is where the real power of revision control comes in.
You can creat a branch of a project so that you can test changes without affecting the main trunk.
if you are woring on the branch (by checking out the branch) any changes you commit will only affect the branch
The main trunk will not be affected.
At a lator date if you are happy with your changes you can merge them back into the main trunk.
To create a branch
1/Open the SVN Log as in the above instructions
2/ right click on the version of the project you want create abranch from. Usually this is the
top item (or Head). ie the current code.
3/In the branch window you will see that the new branch will be a folder in the branches folder named the same as you main project folder.
4/ Enter a log message as always and click OK
You may want to alter the name of the branch before commiting. I usually append the reason for the branch to the name.
eg. trunk/projectname becomes /branches/projectname_rewriteUartDriver
click OK
When you click OK the branch is made in the repository and your current working copy remains to same.
You may want this in which case you need to check out the branch seperately to work on it.
Alternatively you coulf tick the "Switch working copy to new branch/tag" before clicking OK.
This will change your working copy to the new branch after creating it