问题
已经存在仓库1,新建一个仓库2,需要将仓库2与仓库1同步
git add .
git commit "sync"
git push -u origin master -f
! [remote rejected] master -> master (shallow update not allowed)
解决
git fetch --unshallow [repo2]
git push -u origin master -f
git 本地dev分支强行覆盖远端主分支
git checkout develop
git pull
git push origin develop:master -f
git checkout master
git fetch --all
git reset --hard origin/master