To compare any two commits in your branch, use the Ctrl key to select the two commits that you want to compare. Then right-click one of them and select Compare Commits. Similar to Commit Details, you can use the Open in New Tab button to open the comparison on a different tab or maximize it on the screen.
Press "CMD + Shift + P" (on Mac) or "Ctrl + Shift + P" then type "compare" and you can pick which ever option you want.
Select the two files you want to compare (see the diff), right-click, and select “Compare Selected” from the drop-down menu.
Access the "Source Control" tab on the left side of VSCode. Click on the "three small dots" next to the refresh button. Click on the "Checkout to..." option. Choose the branch you want to switch to.
Update: As of November, 2020, Gitlens appears within VSCode's builtin Source Control Panel
I would recommend to use: Git Lens.
UPDATE
Now it's available:
https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory
Until now it isn't supported, but you can follow the thread for it: GitHub
Use the Git History Diff plugin for easy side-by-side branch diffing:
https://marketplace.visualstudio.com/items?itemName=huizhou.githd
Visit the link above and scroll down to the animated GIF image titled Diff Branch. You'll see you can easily pick any branch and do side-by-side comparison with the branch you are on! It is like getting a preview of what you will see in the GitHub Pull Request. For other Git stuff I prefer Visual Studio Code's built-in functionality or Git Lens as others have mentioned.
However, the above plugin is outstanding for doing branch diffing (i.e., for those doing a rebase Git flow and need to preview before a force push up to a GitHub PR).
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