Simple Version Control with TortoiseSVN

When working on small projects, many programmers neglect Version Control systems, maybe because the programming looks simple and requests from clients seem easy to implement, or maybe just because the effort of maintaining some complex repository seems greater than the benefits. They often end up regretting the fact that they didn’t use a system to order and recover project code or files. I’ve tried many software systems to keep using Version Control on small local projects with a minimum effort and one of the best I’ve found is TortoiseSVN.

Here I’m going to describe a quick way to start using Version Control with TortoiseSVN on simple local projects. It’s not about all the nice and tricky things you can do with Tortoise or Subversion, but about how to learn the basics and start using them. In the first part of this tutorial we are going to learn to install it and to add projects to the Repository. The second part will be about using branches and tags.

Installing and adding the first project

  1. Download and install TortoiseSVN. Restart computer as asked.
  2. Create a folder where we are going to place the Repository (the central store place of all saved data). Probably somewhere in the vicinity of our local workspace.
  3. Right-click on the Repository folder and select TortoiseSVN, Create repository here. A dialog should appear and let us know the Repository was created.
  4. Right-click on the Repository folder and select TortoiseSVN, Repo-Browser. Right-click on the right view and then Create folder. Chose the name of the project, enter a short log message (by example “<ProjectName> folder”) and this folder should be visible now.
  5. Create inside the above mentioned <ProjectName> directory the trunk, branches, tags folders (see image). They will be used for saving branches or tags separately from the main project code.
  6. Select the trunk folder, right-click, checkout, set the Checkout Directory to the folder containing the Project we want to save (see image); we will get a warning that the local folder is not empty, click OK. Now we have a versioned folder with all its contents unversioned and we can add the files to the Repository.
  7. Go to the project folder in Explorer and right-click on it, then TortoiseSVN, Add… Select the files/folders for which we want version control (see image). The status of the files being added will be displayed next. Click OK.
  8. Go again to the project folder in Explorer and right-click on it, select SVN Commit. A dialog should be displayed, letting us chose the files to be saved and requesting a Log message from us – details about the current version we are saving (see image). Finally, the files are in the Repository. We can see them in the <ProjectName>/trunk folder in Repo-Browser (if that window was closed we can restart it by left clicking on the Repository folder and then TortoiseSVN, Repo-browser).

Right now everything should be up and running. If we want to save our day’s work all we have to do is the 8th step mentioned above – select SVN commit on the project folder. Only the files that we have changed will appear (see image). Do we want to add a new project? See steps 4 to 8.

Anyway, after those 8 steps we already have a project with Version Control, we can save our work whenever we want and return to a previous version if we did something wrong or deleted something accidentally. We can now see all the files in the Repo-Browser and start using Show log or Revision Graph. More on these and other options in Simple Version Control with TortoiseSVN – part 2.

Useful links

Whenever you feel overwhelmed or things just don’t work try these:

TortoiseSVN doc

Version Control basics :

Wikipedia on Version_control
A visual guide to version control

Images


Repo-Browser view

Repo-Browser view

Chekout view

Chekout view

Adding project files

Adding project files

Adding project files 2

Adding project files 2

Commit files

Commit files

Commit view 2

Commit view 2

Leave a Reply

You must be logged in to post a comment.