0

I would like to compare a file from two commits. I can do it with:

git diff "43bcd06400368174ad5215403fc31c6a8547ac6c:Dashboard.py" "60b47aec1f568d5f3e52aee2499b6265a1b11ad2:Dashboard.py" | code -

The problem with this is the difference will be shown as txt file and therefore I miss the typical python syntax colouring. enter image description here

How can I directly open the difference from Git to VSCode so that it is coloured as python syntax like "comparing changes view" from Github.com?

Thank you for your answer:-)

enter image description here

gunardilin
  • 349
  • 3
  • 12
  • Did you take a look at [this post](https://stackoverflow.com/questions/51316233/how-can-i-see-git-diff-on-the-visual-studio-code-side-by-side-file)? – flaxel Apr 10 '21 at 11:29
  • This is what you are looking for: https://stackoverflow.com/a/60099757/836330 and the setting `Diff Editor: Render Side by Side` disable to see the diffs inline rather than side by side. – Mark Apr 10 '21 at 16:58

0 Answers0