213

I can execute various Git commands from Visual Studio Code, however I couldn't find a way to visualize the history.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
rlesias
  • 2,530
  • 3
  • 11
  • 19

9 Answers9

188

I recommend you this repository, https://github.com/DonJayamanne/gitHistoryVSCode

Git History Git History

It does exactly what you need and has these features:

  • View the details of a commit, such as author name, email, date, committer name, email, date and comments.
  • View a previous copy of the file or compare it against the local workspace version or a previous version.
  • View the changes to the active line in the editor (Git Blame).
  • Configure the information displayed in the list
  • Use keyboard shortcuts to view history of a file or line
  • View the Git log (along with details of a commit, such as author name, email, comments and file changes).
Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
ThormaWeb.com
  • 2,047
  • 1
  • 8
  • 5
  • 18
    Note that you can download it directly from the marketplace. – aloisdg Oct 24 '16 at 21:33
  • 7
    Git History for VS Code in marketplace https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory – naXa Jul 03 '18 at 23:22
  • Excellent repo! – rigerta Aug 02 '18 at 09:02
  • 1
    Does this show the history only after you've installed it? Or would you be able to see commands executed before installing it as well (perhaps VS Code stores it somewhere inaccessible)? – Magne Aug 06 '18 at 07:49
  • 1
    No, I installed it and cannot see the previous history. It shows the history only after its installed – Sathwik Gangisetty Jan 29 '19 at 14:50
  • 3
    I was using GitLens but found it extremely overwhelming. The interface has just too many options. This, on the other hand, is quite straightforward. Liking it so far. – Marc.2377 Oct 24 '19 at 06:01
73

GitLens has a nice Git history browser. Install GitLens from the extensions marketplace, and then run "Show GitLens Explorer" from the command palette.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Joseph Sheedy
  • 5,326
  • 2
  • 26
  • 29
  • The latest version of GitLens is really good. It adds a handy sidebar button and allows you to much better visualize changes across multiple branches. – cham Oct 29 '18 at 21:10
  • yes, i used that, and i highly recommended that extension because it can show in realtime when i click on some link , ref: https://academy.byidmore.com/post/Find-Out-Who-Working-on-This-Line-Via-GitLens-5bd710931bde484c8fbedd33 – yussan Oct 30 '18 at 02:58
  • @JosephSheedy, `GitLens` seams most popular (downloads) extension for reason. – prosti Jun 12 '19 at 06:42
  • Good plugin. Did too much overlaying for me. stackoverflow.com/a/60013101/229906 built in vscode was exactly what I was looking for. – 0llie Sep 22 '20 at 08:36
59

You won't need a plugin to see commit history with Visual Studio Code 1.42 or more.

Timeline view

In this milestone, we've made progress on the new Timeline view, and have an early preview to share.
This is a unified view for visualizing time-series events (e.g. commits, saves, test runs, etc.) for a resource (file, folder, etc.).

To enable the Timeline view, you must be using the Insiders Edition (VSCode 1.44 March 2020) and then add the following setting:

"timeline.showView": true

https://media.githubusercontent.com/media/microsoft/vscode-docs/vnext/release-notes/images/1_42/timeline.png

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • 3
    Can it show branch history? It seems to show selected file history. – Vimes Mar 10 '20 at 16:57
  • @Vimes No, for now it is a time-series events (here, Git commits) for a resource (file, folder). – VonC Mar 10 '20 at 16:59
  • @VonC is there a way in timeline to bring up diff details for then entire commit that the timeline view is showing for a specific file? Is there a way to render "git show " view in vsc vs command line vi editor experience? – myusrn Aug 24 '20 at 18:50
  • @myusrn Not that I know of. That would be a good question on its own. – VonC Aug 24 '20 at 19:18
  • @VonC okay thanks for clarification. While the [git history](https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory) extension mentioned earlier in this thread does provide a way to use ide for view and diff contents of all aspects of a commit in the history log i assumed an oob story would exist for this given timeline is sort of doing this already but at a file scope level. As suggested i created a new SO question for just that issue [here](https://stackoverflow.com/questions/63586751/does-visual-studio-code-have-ide-story-for-reviewing-git-commit-history-and-doin). – myusrn Aug 25 '20 at 20:40
  • This view is available in VS Code 1.44 (March 2020). It's not limited to insiders edition anymore. – zgorawski Oct 13 '20 at 07:29
  • @zgorawski Thank you. I have edited the answer accordingly. – VonC Oct 13 '20 at 11:35
  • It does not seem to show history for a folder, only for a single specific file. – PeteH32 Apr 09 '21 at 22:05
31

It is evident to me that GitLens is the most popular extension for Git history.

enter image description here

What I like the most it can provide you side annotations when some line has been changed the last time and by whom.

Enter image description here

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
prosti
  • 27,149
  • 7
  • 127
  • 118
25

I would recommend using Git Graph extension.

arkhwise
  • 561
  • 7
  • 9
12

I strongly recommend using a combination of GitLens & GitGraph.

Below snapshot highlights how gitlens is showing commit over time

enter image description here

And the below picture is for the the amazing vivid GitGraph

enter image description here

helcode
  • 1,370
  • 1
  • 9
  • 28
8

Git Graph seems like a decent extension. After installing, you can open the graph view from the bottom status bar.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Joe Phillips
  • 44,686
  • 25
  • 93
  • 148
4

You will find the right icon to click, when you open a file or the welcome page, in the upper right corner.

Enter image description here

And you can add a keyboard shortcut:

Enter image description here

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Tobias Otto
  • 1,512
  • 10
  • 18
  • 17
    JIC: ... before to see this option, you need to have **Git History** extension previously installed. – Jhegs Nov 11 '18 at 23:31
  • 1
    Can you update your answer with the prerequisites (after testing it is actually the case)? – Peter Mortensen May 03 '20 at 20:34
  • Thanks @Jhegs, somehow I forgot about reinstalling that extension and was looking for this feature everywhere in the settings ‍♂️ – neojp Feb 19 '21 at 12:58
0

If you need to know the Commit history only, So don't use much Meshed up and bulky plugins,

I will recommend you a Basic simple plugin like "Git Commits"

I use it too :

https://marketplace.visualstudio.com/items?itemName=exelord.git-commits

Enjoy

KRISHNA
  • 161
  • 2
  • 5