Git: Support git history in VSCode
It would be awesome to be able to squash commits right from the UI too
It would be great if we could right click a file and see the Git history for the file. If anyone knows of a nice OS X client that will allow me to easily find a file and view the history then let me know! I've found out how to do it on SourceTree but it's way too fiddly, and GitHub for Mac doesn't have such a feature.
@massimocode just wondering would an action to open the file on github and then view the history there cover your needs? For example there is an open in github extension https://marketplace.visualstudio.com/items/ziyasal.vscode-open-in-github
@egamma that works, but vscode's diff is waaaaaaaaay better than github :) Also, it would be awesome to stay inside vscode to do that
@egamma Hey Erich, thanks for the reply. Unfortunately we're not using GitHub, we're using Stash. It would be great if VSCode has inbuilt support for viewing source control history, like Visual Studio, although I can appreciate it would be a large effort!
It also enables viewing history offline, which is great and leverages one of the main benefits of distributed source control.
Valid points CC @chrisdias
How about an interactive history view, something like git extentions (http://gitextensions.github.io/ ) would be cool!
There is now a git history extension available that you can try: https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory
Yeah, has seen that one before, but its functionality is too limited.
@egamma Thanks this extension is exactly what I was looking for!
the extension is definitely better than nothing, but it's really is more like a makeshift solution. I still use SmartGit's log:
for history tracking. It would be cool if VSCode would ~~steal~~ get something comparable - with a separate interface and functionality to revert, blame, see what's in the other branches without actually switching them...
@massimocode , the githistory extension https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory now supports:
- Viewing history by right clicking on a file in the explorer
- Graphical view of git history
Will update it some time soon with a few more features.

Is there any way using that extension (or any other extension available) to view the diff between two branches? When there's a long commit history with a lot of different contributors and various branches, it's very tedious to go find out which commit corresponds to a given branch, and then scroll through the commit history to find that commit. Even when commit messages shown, it's difficult to keep track which commit is the latest on a given branch.
This git command is very simple and straightforward and does exactly what I want:
git diff origin/master HEADgit diff my-feature-branch(diffs against current working copy)git diff origin/release-branch-1.2.3 origin/release-branch-1.2.4git diff f38ab2egit diff f38ab2e df09c47git diff(between working copy and HEAD)
Unfortunately, the output in the command line is difficult to read and navigate through, so I would love to have the above functionality but be able to view it in VSCode's diff. I find VSCode's diff output to be easy to read, but right now it seems to be limited to only option 6 above. The Git History extension allows me to perform option 4 and 5 above as well, but that is still very limited, as I have to know which commits I want to compare (and the only way to compare a branch is to go separately find out the latest commit on that branch). Perhaps there is a way to do what I want in the extension and I just haven't found that functionality, but I don't know because documentation for the extension is almost non-existent. If anyone here knows how you can compare branches using the extension (or another existing extension) I would love to know.
Currently, my only workaround is to also open my local repo in IntelliJ (since it has built-in functionality to compare any branches or commits) while working in VSCode, so I have to have two IDEs open at once. Given that this functionality is already built into Git with the straightforward git diff command, I'm surprised that there isn't already a VSCode extension built on it that simply renders the diff command output in the VSCode diff.
I see there is no longer anyone assigned to this feature-request. Is it still being considered?
Yes, it's still open. 👍
@DonJayamanne: Does your extension also allow for a more concise visual style that is more suited for for a desktop system?
In general: Has someone considered porting gitk? I'd say it pretty much provides all the features one needs but I don't know how easy it would be to integrate it into VSCode / make a VSCode extension out of it.
So the conversation here rather quickly went from squashing to log inspection. This, however, is the first VSCode hit in a search for 'vscode git squash'. Is there any discussion of that somewhere else?
Is this the right issue for adding a git diff tool for different branches? I see it mentioned here, and I see other threads (#20222) closed with a reference to this issue, though the issue itself seems to just be about history. I would love a diff tool for two branches, I've had a lot of unexpected behavior from merging in the past, where there are no conflicts but code actually gets spliced in weird ways, and want to see all the differences that will be merged, and perhaps handle conflicts preemptively, before actually running the merge.
I have added some preliminary (needs a lot of polishing) support for diff between commits (branches) in the latest release.
Also making use of the new treeview (explorer) to display the commit information.

@MikeGitb
@DonJayamanne: Does your extension also allow for a more concise visual style that is more suited for for a desktop system?
Sorry, the answer is no. You might want to try other tools such as GitKraken (this too is built on topp of Electron, just like VS Code) or the like.
It was actually this extension that gave me what I was looking for: https://marketplace.visualstudio.com/items?itemName=huizhou.githd
@JacobJT Side-by-side Git Diff between branches:
