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?
To help you focus on your Git repository, Visual Studio has a Git Repository window, which is a consolidated view of all the details in your repository, including local and remote branches and commit history. You can access this window directly from either Git or View on the menu bar or from the status bar.
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.
From Using Version Control in Visual Studio Code:
Add this to the Git configuration file, like ~/.gitconfig
:
[diff] tool = vscode [difftool "vscode"] cmd = code --wait --diff $LOCAL $REMOTE
When using git difftool HEAD HEAD^
, Git will ask if to use Visual Studio Code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With