git lfs签出在具有Unicode路径“ Error:CreateFile”的Windows上失败

问题描述

我已经为Windows正确安装了git。打电话

git lfs checkout

在包含特殊字符(C:\ Users \ myUser \öäüü)的路径上使用bash.exe失败,并出现错误:

Error: CreateFile C:\Users\myUser\���: The system cannot find the file specified.

我尝试将GitKraken的LFS文件检出到相同的目录,但失败并出现相同的错误(我也看到GitKraken也调用bash.exe)。当使用git-bash.exe时,我无法重现该错误。两个终端都是MINGW64,即bash.exe打印的语言环境

$ locale
LANG=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=

而git-bash.exe则输出en_GB.UTF-8。我也尝试过这样设置

MSYSTEM=MINGW64

但是不幸的是,这根本没有帮助。 在Mingw-w64模式下使用/ usr / bin / mintty会启动功能正常的bash,我也无法重现该问题。因此,我想知道如何配置bash.exe以使其正常运行,我觉得必须有某种方法可以实现。

编辑: git lfs版本打印

git-lfs/2.12.0 (GitHub; windows amd64; go 1.15.1)

通过GIT_TRACE = 1打印git lfs checkout:

$ GIT_TRACE=1 git lfs checkout
14:12:20.043934 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
14:12:20.059555 git.c:704               trace: exec: git-lfs checkout
14:12:20.059555 run-command.c:663       trace: run_command: git-lfs checkout
14:12:20.079718 trace git-lfs: exec: git 'version'
14:12:20.109504 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' '--git-dir' '--show-toplevel'
14:12:20.132914 trace git-lfs: exec: uname
14:12:20.189343 trace git-lfs: exec: cygpath '-w' '.git'
14:12:20.208415 trace git-lfs: exec: cygpath '-w' 'C:/Users/myUser/äöü'
14:12:20.243879 trace git-lfs: Error running 'git rev-parse': CreateFile C:\Users\myUser\���: The system cannot find the file specified.
Error: CreateFile C:\Users\myUser\���: The system cannot find the file specified.
...

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)