2

We use GitHub for our source code repository and Visual Studio for our development (C#). I downgraded from Visual Studio Professional (Trial) to Community Edition and somehow lost the GIT method history I had above each method signature. I've since reinstalled Pro version and still can't see it. This method history was very useful and looked something like:

Last Update 8/1/2015, 3 authors.
Void DoSomething() {}

Clicking on the status line would bring up things like "compare to previous version", history etc.

I'm not sure if it was a feature of Visual Studio Professional (doubtful) or one of the git extensions I possibly installed (see Tools->Extensions and Updates) or something else. I'm new to using GIT/GitHub, especially with Visual Studio and would appreciate some help. My specific questions

1.  How do I get history/last author/etc for each method (not file)?  Does it work under Professional and Community
2.  What are some good Git Tools to install in Visual Studio to see changes/history, etc.?  I'm using the command line to commit/push etc., but am not opposed to doing this from Visual Studio if it makes sense.

Thanks,

Dave

Dave
  • 8,095
  • 14
  • 56
  • 99

2 Answers2

3

What you initially refer to is a feature of Visual Studio called CodeLens. It's available in the Professional and Enterprise editions of Visual Studio 2015, but not available in the Community edition.

To try and resolve this not working, I would:

  1. Make sure you are actually running Visual Studio 2015 Professional edition, and not the Community edition.

  2. Make sure you have Git for Windows installed.

Steve
  • 1,618
  • 3
  • 17
  • 30
  • Thanks Steve. Thanks for the reference to CodeLens. Did not realize for sure that the feature was not in community edition even though I suspected it. I had to do another fix (see my answer) but your advice got me most of the way. Regards, dave – Dave Jan 16 '17 at 18:45
  • Git for Windows is not required for Visual Studio. In 2015, it uses its own, self-contained git implementation (and in 2017 it installs its own copy of Git for Windows). – Edward Thomson Jan 16 '17 at 18:46
  • Thanks Edward. It seemed like I under got my method history back after putting in Git for Windows. But perhaps it was the clearing the cache (see my answer that did it). In any case, it's working now and I'm not inclined to experiment more :) The link to the CodeLens info was invaluable to me. – Dave Jan 16 '17 at 18:50
  • @EdwardThomson I thought Visual Studio 2015 actually used or installed Git for Windows - e.g. install Git for Windows v2.x.x as stand-alone, then during Visual Studio 2015 install the `Git for Windows [3rd Party]` 'feature' is 'already found on your system... no action will be taken'. Does the Visual Studio 2015 installer actually install a private implementation when the `Git for Windows [3rd Party]` feature is selected? – Steve Jan 16 '17 at 20:05
  • 1
    @Steve VS 2015 does install Git for Windows, but that's because it tries to be helpful for you, not because it's a requirement for its git support. VS 2013 and 2015 use LibGit2Sharp to speak to repositories. (I don't remember if this behavior was in RTM or if it was new in a quarterly update.) This is really just a bit of trivia, really - I saw your answer and thought I'd mention it. :D – Edward Thomson Jan 16 '17 at 20:20
  • Thanks @EdwardThomson! I love hearing about that sort of stuff :D – Steve Jan 16 '17 at 20:21
  • This is a bit off topic but does anyone know if you get method history using bitbucket? – Mark Monforti Dec 29 '17 at 16:57
0

In addition to the excellent answer by Steve (which I'm marking as answer), I'll note that I had additional problems (after installing Git for Windows).

I got errors at startup and didn't see the method info. The errors were: The 'GitCollaborationPackage' package did not load correctly. The 'FileIndicatorPackage' package did not load correctly.

The fix was to rename the componentmodelcache directory under C:\Users\cshar\AppData\Local\Microsoft\VisualStudio\14.0

See: Packages not loading after installing visual studio 2015 RTM or http://kuebiko.blogspot.ru/2013/07/setsite-failed-for-package.html

Community
  • 1
  • 1
Dave
  • 8,095
  • 14
  • 56
  • 99