git submodule update --init --recursive

执行 git submodule update --init --recursive 的时候报错:

fatal: remote error: upload-pack: not our ref fc7223ca00124e8f5b5b354457379071e2fd091b
Fetched in submodule path 'themes/hugo-theme-bootstrap', but it did not contain fc7223ca00124e8f5b5b354457379071e2fd091b. Direct fetching of that commit failed.

解决:

cd {submodule path}
git reset --hard origin/master
cd -
git clean -n
git add {submodule path}
git commit
git submodule update --init --recursive

参考

git - 为什么git子模块更新会因 “fatal: remote error: upload-pack: not our ref"而失败?

版权

评论