查看远程origin地址:
git remote -v
删除现有的origin地址:
git remote remove origin
添加新的origin地址(新建的代码托管地址):
git remote add origin 远程地址
pull远程代码:
git branch --set-upstream-to=origin/<branch> master
git pull origin master --allow-unrelated-histories
正常提交本地代码到新origin地址
原文:https://www.cnblogs.com/Nyan-Workflow-FC/p/14454788.html