问题
在使用 gitea 仓库迁移时,本地 clone 时指定了 --depth=1 导致迁移到新仓库地址时报此错误。
这是由于之前使用了 git clone --depth=
解决
- 先执行
unshallow,添加原来旧仓库的地址:
git remote add old <path-to-old-remote>- 获取旧仓库中的内容
git fetch --unshallow old- 重新
push
git push -f 在使用 gitea 仓库迁移时,本地 clone 时指定了 --depth=1 导致迁移到新仓库地址时报此错误。
这是由于之前使用了 git clone --depth=
unshallow,添加原来旧仓库的地址:git remote add old <path-to-old-remote>git fetch --unshallow oldpushgit push -f