【问题标题】:View ALL Git diffs at once inside VS Code (or other difftools)在 VS Code(或其他 difftools)中一次查看所有 Git 差异
【发布时间】:2019-08-13 13:32:19
【问题描述】:

我已将我的 Git difftool 配置为 VS Code:

[diff]
    tool = default-difftool
[difftool "default-difftool"]
    cmd = code --wait --new-window --diff $LOCAL $REMOTE
    prompt = false

这很好用,但是当有多个文件要比较时,它们会被一个一个打开(VS Code 使用单个文件差异启动,我关闭 VS Code,下一个文件差异打开,等等)。

有没有办法配置 Git,以便在同一个 VS Code 实例中同时打开所有差异?

【问题讨论】:

    标签: git visual-studio-code git-diff


    【解决方案1】:
    1. 安装vscode的文件夹比较扩展:https://marketplace.visualstudio.com/items?itemName=moshfeu.compare-folders

    2. 将 Vscode 配置为 git difftool。将此添加到 ~/.gitconfig

    [diff]
        tool = default-difftool
    [difftool "default-difftool"]
        cmd = code --wait --new-window --diff $LOCAL $REMOTE
    
    1. 使用 -dir-diff 选项调用 git difftool 命令并将 COMPARE_FOLDERS 设置为 diff
    COMPARE_FOLDERS=DIFF git difftool --dir-diff commit1_SHA commit2_SHA
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-12
      • 2022-11-11
      • 1970-01-01
      • 1970-01-01
      • 2023-02-26
      • 1970-01-01
      • 1970-01-01
      • 2017-03-06
      相关资源
      最近更新 更多