Version Control … controlling Past and Present for Future ?? – Part II

Hi Folks,

In previous post, I have shown how the Version Control can be used in general to maintain different version of files so we can work / restore them at any point of change since it’s creation. In this second installment, I will be writing about – How the Version Control Can ease our life as a software developer.

Before I start, following are the tools I have used for “experiment”

· Visual Studio 2010 Pro

· Tortoise SVN

· AnkhSVN (extension used to integrate SVN feature in Visual Studio)

· I am creating sample & simple application in ASP.NET. Which basically is nothing but few labels, textbox and a button.

As the first step, create a Repo (or say SVN REPOSITORY) at location of your choice. Then fireup Visual Studio and choose create new project. This will pop-up project selection box, in which you can select any language you want to work on, on this same box at bottom of right corner, you should see “Add to Subversion” option, select it and click OK.

AnkhSVN_VS_DEMO (1)[4] AnkhSVN_VS_DEMO (3)[3]
AnkhSVN_VS_DEMO (4)[3]

Then you will be presented with Repo. Selection box. Now, if you have already created that repo at said in first step, you will see it listed here. Simply select that repo and click on create new folder, this folder is where we will store our working copy of project, then click Ok. By use, you will not see any different between version controlled project vs normal project because real use of version control is not to give extra functionality but to give simply ability to record every change and let user rollback any time.

So, do some stuff as you like, once done look at the bottom pane (where the ERROR List stays), you should see pane stating “pending changes” click on it to open. You will see all the files listed here that you have created since the creation of project. Simply click on commit and choose commit changes (if you want you can , and you should add comments as well for future reference of changes). Now again do some change (add some code / remove some code) and check this “pending changes ” pane again. You can do the same process as above step to save changes.

AnkhSVN_VS_DEMO (5)[3] AnkhSVN_VS_DEMO (2)[3]

Now if you want to rollback to the code when it was first saved, you can click on “update” and select switch solution, it will present a box where you can select the options of rollback (e.g by rev. no) and simply select for example rev. 1 to rollback to first version, it’s as easy as that.

And this concludes basic tutorial for – “How to use AnkhSVN with Visual Studio for Version Control”

I know that we have many customization options for version control. But I think this is enough for now. May be someday I will do little more “research” and write about it here.

It’s Just a thought … Fingers crossed

Leave a Reply

Your email address will not be published. Required fields are marked *