git双引号解决
13 2025-08-18 10:29
error: invalid path 'main/boards/bread-compact-wifi-with-servo/语音命令"舵机顺时针旋转90度"的执行时序图.mmd'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
报错原因
Git 在 Windows 上 checkout 时,遇到路径中含有英文双引号
Git 在 Windows 上 checkout 时,遇到路径中含有英文双引号
"
,而 Windows 的文件系统不允许路径中出现 " * : < > ? \ |
这些字符,于是 checkout 失败。解决办法
永久根治:把仓库里这个文件重命名
让有 Linux/macOS/WSL/GitHub Codespaces 的人执行一次即可,例如:
让有 Linux/macOS/WSL/GitHub Codespaces 的人执行一次即可,例如:
bash
复制
git mv 'main/boards/bread-compact-wifi-with-servo/语音命令"舵机顺时针旋转90度"的执行时序图.mmd' \
'main/boards/bread-compact-wifi-with-servo/舵机顺时针旋转90度-时序图.mmd'
git commit -m "去掉文件名中的双引号,兼容 Windows"
git push
推上去后,Windows 用户再 clone/checkout 就不会报错了。
全部评论