Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 - local history feature?

The last few years I've been using Eclipse as an IDE. Recently, however, I started working with Visual Studio 2010 and I'm intuitively searching for features I used in Eclipse.

One such is the Local file history. Is there some extension or addon which provides such functionality ?

Another small feature that I'm missing is that I can't just double click on a window to enlarge it, then just double click again and shrink it.

like image 945
datafen Avatar asked Jul 07 '11 08:07

datafen


People also ask

Is there a local history in Visual Studio?

Local History for Visual Studio automatically creates a history of your files every time they are saved. The history can be compared with the current version.

Where is Visual Studio history?

Visual Studio Code allows us to check the history of navigated files in Navigation History lists. You can open this window from “Goto–> Navigation History” or by just simply pressing Ctrl + Tab.

How do I view the history of a file in Visual Studio?

To retrieve a previous version of a file that exists in your Visual Studio project: Right-click the file in Solution Explorer and select View History. The Visual Studio History view will appear, showing the commits in your repo that updated the file.


1 Answers

Not a great answer, but after looking around for this feature and not finding it I decided to build my own. Couldn't get the tool on Codeplex to work with VS2010. Anyway, this post was very helpful and got me on the road to a DIY solution. Note that this assumes that you are not using git as your primary VCS. I suppose if you're using git as primary then you'll want to use mercurial as your 'history' source control.

Steps:

  1. install git
  2. init an empty git repo in the same folder as your solution.
  3. create a VS extensibility project (see post above)
  4. put this to the OnAfterSave:

    m_RDT.GetDocumentInfo(docCookie, out flags, out readlocks, out editlocks, out name, out hier, out itemid, out docData);

    var ctext = string.Format("/c cd {1} && git add \"{0}\" && git commit \"{0}\" -m \"autosave {0}\" ", name, SolutionBaseDirectory);

  5. Now you'll have autosave [the file name] in your git history.

like image 195
jcollum Avatar answered Oct 13 '22 13:10

jcollum