How to compare different branches on Visual studio code 1.9? Is it possible?
问题:
回答1:
I would recommend to use: Git Lens.
回答2:
UPDATE
Now it's available:
https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory
until now it isn't supported, but can follow the thread for it: github
回答3:
Use 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 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 VSCode's built-in functionality or Git Lens as others have mentioned. However, the above plugin is outstanding for doing branch diffing (ie. for those doing a rebase Git flow and need to preview before a force push up to a Github PR).
回答4:
It's now possible by using githistory extension.
Here's a small trick though: You can compare latest commits from each branch and that would be the same as comparing two branches side by side or creating PR.
Here's how to do that using githistory extension:
- Open githistory
- Pick the latest commit from your current branch by clicking on "Git Commit Icon" -> (Usually it should be latest commit it the list). From the opened dropdown menu click on "Select this commit".
- Pick the latest commit from the branch you want to compare to by clicking "Git Commit Icon".
- As a result, dropdown should appear with few options -> Select the last option that says "Compare with SHA" and you'll see the diff.
Hope that helps.
回答5:
I don't use Microsoft Visual Code, I'm using Microsoft Visual Studio (the community version is also free for non-commercial purposes). However, even in this IDE, I haven't figured out how to identify all the differences between two different branches. But you can look at the differences for a specific object in two different commits.
Until I find how to do it in Microsoft Visual Studio, I just use my favorite git GUI to identify all the differences between two commits (within the same branch, or in two different branches). I assume you could just do the same for Microsoft Visual Code.