Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check git history for a range of lines in VSCode

Is it possible in VSCode to show git history for a range of line ?

Let's say I have 1000 commits concerning this file, and a range of line in this file had its last change on commit 24, I have to check 976 commits in the editor.

I saw something related here, but is it possible directly in the IDE?

like image 847
Benjamin Barrois Avatar asked Nov 23 '25 04:11

Benjamin Barrois


1 Answers

You can see the commits related to only a set of lines by using the Gitlens extension.

That provides two functionalities, "File history" and "Line history", that are accessible from the VCS menu once Gitlens is installed.

In the "File history" tab you can see all the commits related to the currently viewed file, whereas in the "Line history" tab you only see the commits related to the currently selected lines.

Example below:

enter image description here

This is the gitlens documentation reference.

like image 127
mattiatantardini Avatar answered Nov 28 '25 16:11

mattiatantardini



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!