Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get a unified git diff in Visual Studio Code?

Tags:

VS Code has a nice built-in Git interface, but it defaults to side-by-side file comparison/diff. Is there a way to switch to unified colored mode?

like image 551
Simon Woodside Avatar asked Mar 03 '17 05:03

Simon Woodside


People also ask

How do I see the Git diff code in Visual Studio?

Our Git tooling supports viewing of diffs within VS Code. Tip: You can diff any two files by first right clicking on a file in the Explorer or OPEN EDITORS list and selecting Select for Compare and then right-click on the second file to compare with and select Compare with 'file_name_you_chose'.

What is the command to check diff in Git?

You can run the git diff HEAD command to compare the both staged and unstaged changes with your last commit. You can also run the git diff <branch_name1> <branch_name2> command to compare the changes from the first branch with changes from the second branch. Order does matter when you're comparing branches.


1 Answers

The official view is a side by side one

enter image description here

But the VSCode Tips page mentions

Inline view

Toggle inline view by clicking more button in the top right.

https://github.com/Microsoft/vscode-tips-and-tricks/raw/master/media/more_button.png ("Toggle Side By Side View")

enter image description here

like image 85
VonC Avatar answered Sep 28 '22 06:09

VonC