Search code examples
gitvisual-studio-codegit-history

How to see `diff` of all the files in one editor panel?


I use VS Code and "git lense", "git history", "git graph" extensions. I made a lot of changes in a lot of files, and I can't see a way, using any of those extensions, to display all my changes in just one window.

I know I can click on a single file (when diffing with a chosen branch), but how to see the diff on all of them? Am I missing something, or maybe there is some other extension which can do that?


Solution

  • One not entirely satisfying answer is : run from the integrated terminal :

    # the '[space][dash]' after 'code' is relevant :
    # it tells vscode to write content received on stdin in a tmp file,
    # and open that file
    git diff | code -
    

    The outpt will be opened as a .txt file, you can additionally change the syntax highlighter to "diff" mode :

    • choose Change language mode from the command palette (Ctrl+K M on linux)
    • in the dropdown list, select Diff