Code Lens for Git in Visual Studio 2013 Ultimate Update 3

Code Lens for Git in Visual Studio 2013 Ultimate Update 3

Rate This
  • Comments 14

Yesterday we released Visual Studio 2013 Update 3 CTP1. This CTP brings new features in the area of CodeLens Team indicators. In this Blog post I'll present the CodeLens Team indicators for Git.

CodeLens Team indicators

CodeLens is a heads-up display in your Visual Studio 2013 Ultimate editor where you can find information about your code in context. If you are not familiar with CodeLens, please see the following MSDN article Get history and other info about your code. Some of the CodeLens indicator for Team Foundation Server Version Control (TfVc) enable you to quickly identify the changes that have happened on the code and the authors of these changes. You can also see the code reviews, work-items and bugs associated with the changes. In addition, since Visual Studio 2013 Update 2, CodeLens shows you incoming changes from other branches. These CodeLens Indicators (Changes, Authors, Code Reviews, Work Items, Bugs & Incoming Changes) are collectively called Team Indicators.

Because they are computed on the server, they required you to connect to t least Team Foundation Server 2013.

Many of you have found CodeLens Team Indicators very useful, and even cool, but you asked us to extend the support of CodeLens Team indicators to other source control systems, including Git and Visual Studio online.

CodeLens Team indicators for Git

We are excited to announce that we are providing a preview of the CodeLens Team indicators for Git. With Visual Studio 2013 Update 3 CTP1, you will only get the Authors and Change indicators for Git, but that is just a start: a work item indicator will follow soon. The User experience with the CodeLens Authors and Change indicators for Git is very similar to the one you get with Team Foundation Version Control (TfVC), but of course this is about Git commits rather than changesets (see details below)

But there is another big difference: the CodeLens Team Indicators for Git are computed on the client side. This means that you will get them for any Git repository, either local, or cloned from TfGit, or even cloned from GitHub or other Git sources.

Deep dive into the Authors and Changes indicators for Git

In the example below, I've cloned the Roslyn open source repository from and opened the Roslyn solution. Let's say that I'm working on a (hypothetical) problem where I'm trying to understand if some recent changes could have provoked a bug I'm investigating. For this, in the Workspaces\Workspaces project, I've opened the SemanticModelWorkspaceServiceFactory.cs. I'm looking at the GetSemanticModelForNodeAsync method

Authors and Changes indicators

Similar to what we have in TfVc, I can see, in addition to the references indicators, that this method was last changed by mattwar, and another person did a change, and there were two changes overall:


The details popup

Clicking on the author indicator (or the changes indicators: for the moment, the details are the same), I can see similar information to what we have in TfVc:

  • Commit ID,
  • the Description of the commit,
  • the Author of the commit, and
  • the Date of the commit


Hovering on a line corresponding to a Commit in the Commit Details window shows a tooltip giving more detail:


Right-clicking on a line corresponding to a Commit shows the contextual actions for this commit:

  • View the Commit Details (in the Team Explorer Commit Details page - see below)
  • Interact with the author of the change. This interaction will be more or less rich depending on what is installed on your machine. Here Lync is installed on my machine so I can interact with the author through Instantaneous Messaging. The Contact Card will also be very detailed, as we are in the same company so the Active Directory provides me with a lot of information.


How to understand the changes to the method made in this commit

Requesting the Commit Details shows the details in Team Explorer. That will be a good location if you want to copy the commit short Id to use with command line tools, if you are used to using them. We know that for some of you this is important.


Note that the Commit Details window shows you all the files in the commit, which is desirable for you to understand the whole story. However, if you are only interested in the changes for the file you are looking at, you can use the "View Options" drop down and choose to Show the Filter


Then you'll have to type, or copy / paste the name of the file (personally, if I'm only interested in seeing this file, I'd paste the full path that I would have got from the "Copy Full Path" contextual command on the file tab).


From there you can compare the changes in this file with the previous version if you wish.



When are the indicators refreshed ?

In this CTP, the indicators will not yet refresh automatically when you Commit a change, pull or Sync from a remote repository, or change the branch. This will be available in a later CTP or version of Visual Studio 2013 Update 3.

There is a work around which is to manually refresh the indicators by right-clicking on an indicator and clicking on "Refresh CodeLens Team Indicators"



What if I don't want to see the Git Team Indicators?

If you are not interested in seeing the Git Team Indicators, you can disable them through the CodeLens Options contextual command above, or through Tools | Options [ Text Editor / All Languages / CodeLens]:


In closing

As always, we are interested in hearing your feedback on this feature. Please try it out, and let us know.

Leave a Comment
  • Please add 2 and 7 and type the answer here:
  • Post
  • Two things.

    1) The Microsoft Git Provider seems to break R# under certain conditions.

    2) Can you please bring CodeLens to Premium? I live in Australia and Ultimate is just not affordable (it's arbitrarily 2x more expensive in AU$ than US$ -- AU$21,201.00 vs US$13,299.00).

  • Great feature that would assist a lot of regular developers that is unfortunately locked away in the Ultimate edition.  I'm in Australia too, and the $21k+ price tag is kind of ridiculous.

  • Great feature. Really significant for many developers. But I'm agree with previous commentators, as git indicators can interact directly with any Git repository, it's a shame that this feature is dedicated to Ultimate edition.

    At least for git, any chance to deliver this feature as a special visual studio extension ?

  • I second #2 by It would be amazing to have CodeLens available in something other than Ultimate!

  • Was reading this then I realized that I only have a VS 2013 Professional licence... waste of time... keep it up MSFT

  • Thank you for indicating this is an Ultimate-only feature in the title. It saves those of us who don't have Ultimate time trying to figure out which edition the feature is in.

  • In Poland you have to pay 70 356 zł for Ultimate Edition, it's US$23 000 ( 1 US dolar == 3.0532 zł )

    Do you really think that in a country where the average salary is approximately US$1200 per month someone will pay 23 thousands for a developer tool? NEVER

  • Is there anything in the Visual Studio SDK to add some custom code lens indicators?  For example I would love to be able to code an indicator that would show the JIRA issues associated with a git commit, as we don't use TFS.

    As for Ultimate, it isn't the price that is so much the problem, the real problem is that there isn't enough stuff in Ultimate that isn't in Premium to justify the price jump.  Code Lens and Intellitrace are great, but are they worth an extra $10,000 per user?  It feels like Microsoft should put more functionality in Ultimate, or just kill the SKU and make Premium to top SKU.

  • Nice, but crazy price, especially for GIT.

    Very few people in the world get to see Ultimate...

  • I suspect the majority of those using GIT does not have Ultimate stop wasting your time.

  • Is that compatible with Visual Studio Online?

  • To Gil: yes, this is compatible with VSO, if you use Git repositories in VSO, of course.

    Regards Jean-Marc

  • I'm using GitHub enterprise. I'm seeing the "work item" shortcuts, however when I click on it, I get this message:

    "Unable to determine the team project collection. Please connect to the appropriate team project collection and try again"

    I am currently connected to the correct repo. If this is because you don't support GitHub enterprise and only TFS Git, then the 'work item' link shouldn't even be shown.

  • @Morten -

    I know this is an old issue, but I got the same error ins Visual Studio 2015 using TFS Git until I realized that although I had connected to the Git repo in VS I hadn't actually connected to the TFS Server in in VS. Connecting to the TFS server fixed it.

    Hopefully this helps someone else who like me stumbled across this article while trying to figure this out.

Page 1 of 1 (14 items)