Is there a way to see git diff from origin/master using Visual Studio Code?

Usman picture Usman · May 16, 2017 · Viewed 61.2k times · Source

Using Visual Studio Code (version 1.11.2), I can see a side-by-side graphical diff of my current changes very easily by clicking the Source Control button in the left panel. But once I commit those changes to my local repository, I am unable to find a way to see the same side-by-side diff from origin/master.

In other words, is there a way to the spawn comparison tool of Visual Studio Code (version 1.11.2) to show me what I see when I do git diff origin/master, but in the side-by-side graphical diff too?

Answer

Luís Henrique Faria picture Luís Henrique Faria · Jun 23, 2017

You can use an extension for this.

Two good options:

Gitlens: https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens

With this one, you can use the >GitLens: Open Changes with... action to compare with any branch (local or remote).

You also can use Git History: https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory

You can see the entire file history and compare with the current version with the >Git: View File History action.