git - Sublime Text 3 + Git 包 : won't launch difftool (Meld)

标签 git sublimetext3 diff git-difftool

我正在使用 Sublime Text 3 加上 Git包来管理我的仓库。我已将 .gitconfig 文件设置为使用 Meld工具(Meld v3.14.2):

[diff]
    external = meld
    tool = meld

我可以使用 $ git difftool 从命令提示符启动它,没有任何问题。

我过去可以通过 Git Diff Tool Current FileGit Diff Tool All 命令对 git 包执行相同的操作。重新安装 Sublime Text 3 后,当我尝试执行这两个操作中的任何一个时,Sublime 底部的窗口会出现,询问:

Viewing (1/1): 'test.py'
Launch 'meld' [Y/n]: 

这里无法输入任何文字,而且以前也不需要输入。如果我尝试 Git Diff Current file 它会打开一个新选项卡:

Usage: 
  meld                                 Iniciar con una ventana vacía
  meld <archivo|carpeta>               Iniciar una comparación de control de versiones
  meld <archivo> <archivo> [<archivo>] Iniciar una comparación de archivo de 2 ó 3 vías
  meld <carpeta> <carpeta> [<carpeta>] Iniciar una comparación de carpetas de 2 ó 3 vías

Error: too many arguments (expected 0-3, got 7)

fatal: External Diff died, stopping at test.py

(大致翻译自西类牙语)所以看起来 Meld 的参数没有正确传递。这是我的默认配置文件,我没有用户配置:

{
    // save before running commands
    "save_first": true

    // if present, use this command instead of plain "git"
    // e.g. "/Users/kemayo/bin/git" or "C:\bin\git.exe"
    ,"git_command": false

    // if present, use this command instead of plain "gitk"
    // e.g. "/Users/kemayo/bin/gitk" or "C:\bin\gitk.exe"
    ,"gitk_command": false

    // point this the installation location of git-flow
    ,"git_flow_command": "/usr/local/bin/git-flow"

    // use the panel for diff output, rather than a new scratch window (new tab)
    ,"diff_panel": false

    // If you'd rather have your status command open files instead of show you a
    // diff, set this to true.  You can still do `Git: Status` followed by
    // 'Git: Diff Current File' to get a file diff
    ,"status_opens_file": false

    // Use --verbose flag for commit messages
    ,"verbose_commits": true

    // How many commit messages to store in the history. Set to 0 to disable.
    ,"history_size": 5

    // Show git flow commands
    ,"flow": false

    // Annotations default to being on for all files. Can be slow in some cases.
    ,"annotations": false

    // statusbar
    ,"statusbar_branch": true
    // Symbols for quick git status in status bar
    ,"statusbar_status": true
    ,"statusbar_status_symbols" : {"modified": "≠", "added": "+", "deleted": "×", "untracked": "?", "conflicts": "‼", "renamed":"R", "copied":"C", "clean": "✓", "separator": " "}

    // e.g. "Packages/Git/syntax/Git Commit Message.tmLanguage"
    ,"diff_syntax": "Packages/Diff/Diff.tmLanguage"

    // Rulers for commit view
    ,"commit_rulers": [70]

    // Watch for gitignore changes?
    ,"gitignore_sync": false
}

最佳答案

看起来你需要将 git 设置为不提示。在您的 .gitconfig 文件中,添加:

[difftool]
        prompt = false

关于git - Sublime Text 3 + Git 包 : won't launch difftool (Meld),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39881866/

相关文章:

git - 在错误的 git push 之后, 'everything up to date' 阻止推送任何东西

git - 有没有一种干净的方法来处理两个以相同内容开头的原始 git 存储库?

python - 代码段无法在 ST3 中静默插入

css - 如何在 sublime text 3 上永久设置 sublimelinter css 规则?

svn - KDiff3如何与TortoiseSVN正确使用来解决冲突?

git - 在 Azure DevOps 项目之间移动存储库时保留 pull 请求

git - 从 fork 推送时 merge 冲突的正确方法?

visual-studio-code - 如何在多行编辑的末尾添加不同的数字?

php - HTML 解析器的 Git 补丁

github - GitHub 比较 View 中的红色文本背景意味着什么?