问题
This answer shows how to see the differences between a specific file foo.bar in two different branches in git. My question is how to do this within magit?
回答1:
I use magit to complement vc. vc already has this functionality C-u C-x v =
回答2:
Just wanted to note that this is now directly possible with magit.
In the Magit status buffer, type d to open up the diff popup.
Then limit the diff to your file of interest with =f and the file name.
Finally, do a diff range r and type in the branch that you want to compare to (one can also type in a specific commit on the same branch, see a similar question).
来源:https://stackoverflow.com/questions/16358936/compare-foo-bar-from-two-different-branches-in-magit