views:

107

answers:

7

forgive me, but I don't know the technical term to know what to search for.

I am trying to find a way to keep track of changes in my code during the development of my program. something that would allow me to go back to a section of code that I deleted. I am not talking about "undo". But rather a way that would let me keep track or be able to retrieve a section of my code that I deleted but now want it back.

Is there such a way. If there is, then what is this whole system/procedure called? Is there something that integrates with visual studio 2010?

Many thanks for your help.

A: 

Every source control does that, you know ;)

YOu have a legal VIsual Studio 2010? Try Team System.

TomTom
Do you need the whole of Team System just for version control? Can't regular VS Professional use Team Foundation Server?
JBRWilkinson
Actually yes, it can.
TomTom
+6  A: 

It's called Revision Control.

Olivier
many thanks for your answer. I had no clue.
mazrabul
+6  A: 

you could use

SVN or GIT

but for local use, I would prefer SVN. its free and its easy. For visual studio there are a few SVN client plugins (like VisualSVN). But, I would suggest TortoiseSVN as the client.

To be clear, SVN is the server, TortoiseSVN is the client. (Both are free open source tools)

SysAdmin
many thanks. 3 options in one comment. Brilliant.
mazrabul
We have found TortoiseSVN + VisualStudio to be an excellent combination, and then there's VisualSVN Server - which is free, and easy to setup.
JBRWilkinson
+1  A: 

I'm not familiar with Visual Studio, but generally there are two approaches to implementing this:

1) Source/Revision control - But the problem is that it is very low-granularity, you usually commit a file when it is ready, but lose any interim changes. There are a lot of solutions compatible with visual studio.

2) A local history that tracks multiple versions between commits. Eclipse has this built in, not sure how to access it in VS.

3) A very granular log of all your development activities so you can examine and revert past changes. Not familiar with a commercial version of this. I once developed something like this for Eclipse.

Uri
many thanks. The second and third approach are exactly what I am looking for. Too bad I only use/know visual basic, otherwise I would seriously consider switching to eclipse.
mazrabul
For option #2, Since your project files are in a specific directory, you could use a backup software to make an incremental backup of your code directory every X minutes so you could at least go back.
Uri
+1  A: 

Please read this thread here at SO: Keeping track of changes I make by copying project folders.

Bartosz
+1  A: 

subversion has a lot of mind share these days, but it's very old-school, first-gen tech. Distributed revision control is gaining a lot of momentum and I'd highly recommend that you become familiar with it if you're going to be a code monkey professional. Look up mercurial (also referred to as hg) or bazaar. If nothing else, perforce - a professional, commercial revision control tool - is free for up to two users. It works very well, as long as you keep your branching craziness to a minimum.

I used to really like perforce, but I'm now a build engineer and it is a pain in the rear to use with any mature automation system. To say the least, it is showing its age.
+2  A: 

The term you are looking for is Source Control. Modern source control's provide all the functionality you described plus much more.

Team Foundation Server seamlessly integrates into VS2010 and is very useful. Read through Source Control for Visual Studio to get up to speed.

Sorax
many thanks. I will look into it. i feel a bit stupid that such a thing exists and is widely used while I had no idea...
mazrabul
You'd be surprised to discover how many development studios still don't use source control, even though it's clearly critical, so you're not alone. And as AakashM said above, I think it's great that you realized the need for it on our own. I found a very helpful CodeProject article that lays out the steps involved in integrating TortiseSVN into Visual Studio: http://www.codeproject.com/KB/dotnet/SourceControl_VSNET.aspxGood luck!
Sorax
many thanks for the link. It proved extremely helpful.
mazrabul