我想在某个标签处创建一个 git 存储库的稀疏和浅层克隆。
这就是我目前正在做的事情:
git init avatica-tmp
cd avatica-tmp
git remote add origin https://github.com/apache/calcite-avatica/
git config core.sparsecheckout true
echo "core/src/main/protobuf/*" >> .git/info/sparse-checkout
git pull --depth=1 origin rel/avatica-1.10.0
它可以正常工作,但会引发错误:
remote: Counting objects: 531, done.
remote: Compressing objects: 100% (381/381), done.
remote: Total 531 (delta 147), reused 280 (delta 51), pack-reused 0
Receiving objects: 100% (531/531), 963.03 KiB | 233.00 KiB/s, done.
Resolving deltas: 100% (147/147), done.
From https://github.com/apache/calcite-avatica
* tag rel/avatica-1.10.0 -> FETCH_HEAD
fatal: update_ref failed for ref 'HEAD': cannot update ref 'refs/heads/master': trying to write non-commit object fe4f0b4ea3e2ee4f3b2e82329363a7945493a8c9 to branch 'refs/heads/master'
我在 Ubuntu 17.04 上使用 Git 2.11.0 和在 Windows 10 64 位上使用 Git 2.13.2.windows.1 时遇到此错误。我没有尝试克隆到映射驱动器。
是什么导致了这个错误,我该如何避免它?