1

In IntelliJ there's the option to select some code then right click -> 'Git' -> 'Show history for selection', which will show the commits on which the selected lines did change alongside with the changes made.

Is there a plugin or some way to achieve the same thing in VS Code?

EDIT: I'm only asking if there exists a plugin that does this, I'm not asking for "what you think is best". If there's a single plugin that does exactly what I'm asking for, that would be the answer.

RabidTunes
  • 775
  • 1
  • 8
  • 21
  • [gitlens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) – starball Feb 23 '23 at 22:23
  • @user Can you please elaborate how can I achieve that with Gitlens, I have the plugin installed but I don't see the option when selectin some code. – RabidTunes Feb 24 '23 at 07:45
  • @user I just noticed the feature, there was another question (it seems that I didn't search properly) that answers my question https://stackoverflow.com/questions/70987529/check-git-history-for-a-range-of-lines-in-vscode – RabidTunes Feb 24 '23 at 19:35
  • Note: Explicit software recommendation questions are **off-topic** on Stack Overflow for the reasons explained in #3 of [/help/on-topic](/help/on-topic). – starball Feb 24 '23 at 19:37

1 Answers1

0

As one of ways, you can install the plugin separately named as: Git History

apply it inside VS Code and use according to your needs:

Source link: https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory

invzbl3
  • 5,872
  • 9
  • 36
  • 76
  • This shows history for a single line, not a selection of lines. When selecting multiple lines and showing history for line it shows the history of the right-clicked line, not the selection. – RabidTunes Feb 24 '23 at 07:44
  • 1
    @RabidTunes, I got your point here. I'll update my answer without any problem if I find something related to selection of lines. – invzbl3 Feb 24 '23 at 23:15
  • 1
    I appreciate the effort very much, however, as I marked, it seems that there's a question that already has my answer, adding Gitlens and using the Git tab with Line history enabled did the trick for me. – RabidTunes Feb 25 '23 at 09:07