git - 适用于 Linux 的 Windows 子系统 git mergetool 融合了 UnicodeDecodeError

标签 git utf-8 windows-subsystem-for-linux meld mergetool

我是 WSL(Linux 的 Windows 子系统)用户。
我使用 WSL 在我的主机和远程编译机器 (RedHat) 之间简单地 rsync 源代码。我找到了这样一篇文章:

https://www.deptagency.com/en-gb/story/using-meld-as-a-git-merge-tool-on-windows/

它从 WSL 触发并运行 GUI 窗口。

但是按照本文中的步骤操作后,我收到了这个错误消息(我已经检查过 Windows EoL 是否已通过):

回溯(最近一次调用最后一次):
文件“bin/meld”,第 328 行,在structured_log_adapter 中
UnicodeDecodeError: 'utf-8' 编解码器无法解码位置 103 中的字节 0x93:起始字节无效

你有什么想法?

提前致谢,
BR

最佳答案

您是否尝试过当前版本的 Meld https://meldmerge.org/ .我遵循了提供的链接 https://www.deptagency.com/en-gb/story/using-meld-as-a-git-merge-tool-on-windows/没有任何问题。

详细步骤

https://meldmerge.org/ 在 Windows 10 上下载并安装 meld

导航到您的 wsl 终端
创建一个脚本将东西传递给融合

nano meld

#!/bin/bash

/mnt/c/Program\ Files\ \(x86\)/Meld/Meld.exe $@

使脚本可执行

sudo chmod +x meld

将脚本移至 /usr/bin
sudo mv meld /usr/bin

然后,在 ~/.gitconfig添加/编辑以下内容

[merge]
    tool = meld
[mergetool "meld"]
    cmd = meld --diff \"$BASE\" \"$LOCAL\" \"$REMOTE\" --output \"$MERGED\"

导航到存在 merge 冲突的 git 目录



git mergetool

享受!

关于git - 适用于 Linux 的 Windows 子系统 git mergetool 融合了 UnicodeDecodeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51642736/

相关文章:

linux - Git 推送到 master repo 然后将 dist 文件夹发送到特定路径(/www/site/v0.0.1)?

bash - Windows 10 - Bash (Ubuntu) SU(根密码)

linux - 在 Ubuntu 18.04.2 LTS 上运行 docker

Git 将文件保存在存储库中但停止跟踪本地更改

用于搜索提交消息的 Git 别名

delphi - 我应该用什么? UTF8 还是 UTF16?

mysql - 加密mysql文本信息/欧洲语言支持

php - 如何将字符串保存在mysql数据库中

windows-subsystem-for-linux - 如何在 Windows 终端中将 Ubuntu 添加为配置文件选项?

git - 如何禁用 VSCode Git Rebase UI