Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an IntelliJ-like feature "Compare with branch" for Visual Studio Code

I was wondering if there is an extension for Visual Studio Code which enables us to compare any arbitrary file in current branch with the same file in another branch. In Intellij, there is a 'compare with branch' option using which I can compare the state of my file in current branch with the same file in any other branch. This comes in handy a lot of time and I don't have to go to GitHub if I want to compare the changes done with the target branch prior to creating a pull request.

like image 379
Vijender Kumar Avatar asked Oct 15 '25 16:10

Vijender Kumar


1 Answers

Yes the GitLens extension gives you the possibility to do this via:

Explorer Context Menu > Open Changes > Open Changes with Branch or Tag...

enter image description here

i.e. open the context menu for the file (on Windows right-click on the file) you want to compare and choose the above from the context menu. Then enter the branch you want to compare to.

like image 116
user2846469 Avatar answered Oct 17 '25 05:10

user2846469



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!