In this post, I'll show how to search and compare different branches in VS Code. This is an easy and straightforward procedure using a Vscode extension.
Shortest Way
git diff master..feature
Smart Way
In this method, we're using a Vscode extension called Gitlens to search and compare two branches. You can use the same method for comparing two commits.
Requirement
- VS Code : https://code.visualstudio.com/download
- Gitlens (Extension): https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens
How it Works GIF
Step by step
Click Source Control & select SEARCH & COMPARE from your VS Code
Click on Compare References
Select the branches you want to compare
Now, you can compare the files from the different branches
References
Let's connect,