Douglas
Douglas

Reputation: 4183

How to show full-file Git blame in Visual Studio Code

At one point I found a way to show line-by-line Git blame within Visual Studio Code. I now cannot recall or find the means with which to do that. I have the Git Blame extension, but that only shows blame on a single selected line.

Upvotes: 336

Views: 297590

Answers (9)

Radu S.
Radu S.

Reputation: 21

Git Blame W77 is a lighweight extension that does what you want. I tested it myself seems to work well.

enter image description here

Upvotes: 1

derek
derek

Reputation: 826

I just installed Git Blame. It's out a while now, but it seems to be lightweight and very easy to use. I was able to get line-by-line details of who and when.

Enter image description here

Upvotes: 48

chb
chb

Reputation: 1995

I don't like the way GitLens integrates into Visual Studio Code. After looking around and trying a number of other git-related extensions, I settled on Git History. It can be installed via VSCode Quick Open (typically, Ctrl+P) with ext install donjayamanne.githistory.

It provides both full file and line-specific git blame from the context menu:

Enter image description here

Upvotes: 8

omnesia
omnesia

Reputation: 2867

If you use the GitLens plugin, you can also use the "File Annotations" icon in the top right of Visual Studio Code:

GitLens - File Annotations Menu

Or use the "GitLens: Toggle File Blame" command.

Upvotes: 73

SamB
SamB

Reputation: 3245

You can view the commit history for an individual file without a plugin using the Timeline view.

Enter image description here

See How can I view the Git history in Visual Studio Code? for more information.

Upvotes: 38

milan
milan

Reputation: 12412

On Mac, if you have the GitLens plugin, it's Command + Option + G + B:

Enter image description here

Upvotes: 36

Parag Diwan
Parag Diwan

Reputation: 3918

Use the Gitlens extension. It supports various options. Once installed, you can use Alt+B to show the full file blame information.

Upvotes: 313

Thameur Saadi
Thameur Saadi

Reputation: 359

Add the Annotator extension. Here is the marketplace link to add it.

Source code: https://github.com/ryu1kn/vscode-annotator

Upvotes: 21

maverick_devil
maverick_devil

Reputation: 57

GitLens provides the functionality of full-file git blame. To execute the command:
Press Ctrl+Shift+G, followed by pressing only B.

Note: When pressing B, do not press the Ctrl and Shift buttons. The command will work correctly in this manner.

I have personally validated this command on VS Code version 1.81.0 and GitLens version 14.2.0. Some users have reported issues with this command, but it's possible they are inadvertently pressing Ctrl and Shift buttons while pressing B.

Upvotes: 5

Related Questions