How to blame previous versions of a specific line of code in VS 2015?
Asked Answered
S

3

12

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...

Stratosphere answered 2/6, 2016 at 15:21 Comment(2)
Do you not have an option for seeing the file history?Vinylidene
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?Stratosphere
S
2

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.

Stratosphere answered 13/6, 2016 at 19:36 Comment(1)
But "Annotate This Version" does not show changes made to the line in previous commits, which is what is requested.Dittmer
L
5

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

Laural answered 9/2, 2021 at 14:56 Comment(0)
N
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

Niall answered 10/10, 2019 at 0:28 Comment(0)
S
2

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.

Stratosphere answered 13/6, 2016 at 19:36 Comment(1)
But "Annotate This Version" does not show changes made to the line in previous commits, which is what is requested.Dittmer

© 2022 - 2024 — McMap. All rights reserved.