BlackWaspTM

This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

Visual Studio
VS 2005+

Tracking Changes in Visual Studio

The Visual Studio code editor includes lots of features to assist developers. One of these is the ability to track changes. When code is modified, a colour coded bar in the margin indicates the current status of the code compared to the saved file.

Change Tracking

Microsoft introduced a change tracking feature in the code editor for Visual Studio 2005. This feature was maintained in Visual Studio 2008 and enhanced with Visual Studio 2010. The feature is simple to use and can be helpful when making code modifications. Any change that you make is highlighted with a colour coded bar in the left hand margin area.

The original version of the feature uses two colours. On opening a code file, no coloured bars are present. When you make a change, a yellow bar is placed to the left of the affected lines. This indicates that the code is different to the code when the file was loaded and that the changes have not yet been saved to disk. When you save a file, all of the yellow bars change to green. This tells you that the lines have been modified since the file was opened but that these changes have been saved.

Visual Studio 2010 adds a third colour. When you change the code in such a way that it matches the originally opened version but is different to the saved file, the lines are highlighted with an orange bar. You can see this by following several steps. First open a file and modify it to see a yellow bar. Next, save the file to see the bar change to green. Finally, undo the change. The bar turns orange.

You can see an example of yellow and green bars in the image below. Here Visual Studio 2008 was used to edit a file. The lines within the using statement were modified and the file was saved. The using statement lines were added after saving so are shown with a yellow colour.

Visual Studio Track Changess

Visual Studio tracks changes by default. However, it is possible for this feature to be disabled. If you cannot see the coloured bars, open the Tools menu and click Options to see the Options dialog box. Open the "Text Editor" branch of the tree and select "General". To enable change tracking, ensure that the "Track Changes" and "Selection Margin" checkboxes are both ticked.

12 July 2011