원격 Git 저장소 주소를 변경, 강제로 원격 저장소를 밀어

원격 저장소를 밀어 강제

#把一个现有的工程拷贝一份
#去掉远程仓库关联
git remote rm origin
#添加远程仓库关联
git remote add origin http://xxx.git
#强行推送
git push origin --force

#可能会推不上去,提示,要确定推动到哪个分支
$ git push origin --force
fatal: The current branch dev has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin dev

#按照提示操作,直推送 dev 分支到远端
git push --set-upstream origin dev

추천

출처www.cnblogs.com/wjw-blog/p/11402073.html