Is it possible to ignore white-space when viewing code differences of a file (generated by GIT) in Visual Studio Code? That will be really helpful in checking for actual code additions/deletions before committing.
We use the git diff --ignore-space-at-eol command to ignore whitespace changes at the end of our lines. Whitespaces at the beginning and in the middle of lines will remain in the git diff output. The git diff --b is the short form for the git diff --ignore-space-change that ignores whitespace at the line end.
On github, you simply append the w=1 parameter to the URL for it to ignore whitespace.
Viewing diffs# 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'.
In Visual Studio for Windows, to display whitespace characters (tabs, spaces, etc) you simply press Ctrl + R, Ctrl + W.
Add on your settings.json
:
"diffEditor.ignoreTrimWhitespace": true,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With