在 VS Code(或其他 difftools)中一次查看所有 Git 差异 [英] View ALL Git diffs at once inside VS Code (or other difftools)

查看:18
本文介绍了在 VS Code(或其他 difftools)中一次查看所有 Git 差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have configured my Git difftool to be VS Code:

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

这很好用,但是当有多个文件要差异时,它们会一个一个地打开(VS Code 启动时只有一个文件差异,我关闭 VS Code,打开下一个文件差异,等等).

This works fine, but when there are multiple files to diff, they get opened one by one (VS Code launches with a single file diff, I close VS Code, the next file diff opens, etc).

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

Is there a way to configure Git so that all diffs are opened at once in the same VS Code instance?

推荐答案

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

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

Configure Vscode as the git difftool. Add this to ~/.gitconfig

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

  1. 使用 -dir-diff 选项和设置为 diff 的 COMPARE_FOLDERS 调用 git difftool 命令

COMPARE_FOLDERS=DIFF git difftool --dir-diff commit1_SHA commit2_SHA

这篇关于在 VS Code(或其他 difftools)中一次查看所有 Git 差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆