以下列举在git中可能会存在的各种玄学错误:
01
git的链接错误
如下错误
Failed to connect to github.com port 443: Connection refused
destination path ‘CVE-2021-21300’ already exists and is not an empty directory
解决方法:
可以使用代理或者更换代理节点
稍等一段时间后重试
02
already exists and is not an empty directory
如下错误:
fatal: destination path ‘CVE-2021-21300’ already exists and is not an empty directory.
解决方法:
重新clone需要删除原有文件
03
warning:Clone succeeded, but checkout failed
如下错误:
error: unable to create file A/post-checkout: No such file or directory
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with ‘git status’
and retry the checkout with ‘git checkout -f HEAD’
解决方法:
clone时需要添加参数 -c core.symlinks=true 开启git对符号链接的支持
04
Encountered 1 file(s) that should have been pointers, but weren’t : A/post-checkout
解决方法:
在构造恶意仓库时发生错误,重新检查各需要检查的文件内容是否正确,软链接是否正确
05
Error when cloning a repo – Smudge error, error: external filter ‘git-lfs filter-process’ failed, smudge filter lfs failed
解决方法:
检查恶意仓库中的lfs文件是否正确存储到Git Lfs上