git clone 旧项目url
git remote rm origin
git remote add origin 新的url
git push origin master:master --force
报错
error: src refspec master does not match any
error: failed to push some refs to xxx
查看当前分支 是否为master,如果为main,创建master分支
git checkout -b master
再提交
git push origin master:master --force
如果过程中报
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
请再次
git remote add origin 新的url