0.摘要
当Git服务器的IP地址变动,或者由于其它原因需要更换远程仓库地址的时候,可以采用先删除远程仓库地址,然后重新关联新地址的方式。
1.更换远程仓库地址
git remote rm origin # 取消与远程仓库的关联
git remote add origin [email protected]:/home/git/new.git # 关联新的远程仓库
关联完成之后,可以通过git remote -v 进行查看。
0.摘要
当Git服务器的IP地址变动,或者由于其它原因需要更换远程仓库地址的时候,可以采用先删除远程仓库地址,然后重新关联新地址的方式。
1.更换远程仓库地址
git remote rm origin # 取消与远程仓库的关联
git remote add origin [email protected]:/home/git/new.git # 关联新的远程仓库
关联完成之后,可以通过git remote -v 进行查看。