11

I'm using Visual Studio 2015 with Git integration. What I'm trying to achieve is going back in the history of a specific line of code.

I know there is Source Control > Annotate. But then I get only to see the latest change. Then, I can right-click the line on the annotations gutter and say "Annotate This Version" which will give me the latest change for that specific line. But from there, how to get back in history for that line? "Annotate This Version" is greyed out...

Dejan
  • 9,150
  • 8
  • 69
  • 117
  • Do you not have an option for seeing the file history? – ChrisF Jun 02 '16 at 15:25
  • 2
    I do. But that's _file_ history. I want to check _line_ history. Or how would I efficiently know who/how changed a specific line when looking at the file history? – Dejan Jun 02 '16 at 15:39

3 Answers3

3

The "Annotate This Version" found in the context-menu of the left gutter works just as expected. In my case, the history didn't follow a file rename which was confusing me.

Dejan
  • 9,150
  • 8
  • 69
  • 117
3

Visual Studio Online has a Blame view for files that lists the commit responsible for each line, and adds a rollover that will take you to the previous commit that modified that line. The tooltip says "View blame prior to this commit" Nifty!

VS Online - View blame prior to this commit

Tom A
  • 595
  • 7
  • 16
3

This is not supported. There is a feature request on Visual Studio community website: https://developercommunity2.visualstudio.com/t/blameannotate-previous-versionrevision/668315

Kiruahxh
  • 1,276
  • 13
  • 30