公司搬移, 作为git仓库的服务器IP地址变了。 本地代码挺多,重新检出太占时间,可以修改一个什么配置让我本地仓库和新的远程仓库建立关联吗, 答案是肯定的!
以下均以项目git_test为例:
老地址:http://192.168.1.12:9797/john/git_test.git
新地址:http://192.168.100.235:9797/john/git_test.git
远程仓库名称: origin
1.进入git_test根目录
2.git remote 查看所有远程仓库, git remote xxx 查看指定远程仓库地址
3.git remote rm origin
4.git remote add origin http://192.168.100.235:9797/john/git_test.git
1 2 3 4 5 6 7 8 9 10 11 |
[core] repositoryformatversion = 0 filemode = true logallrefupdates = true precomposeunicode = true [remote "origin"] url = http://192.168.100.235:9797/shimanqiang/assistant.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master |
修改 [remote “origin”]下面的url即可
原文链接:https://blog.csdn.net/asdfsfsdgdfgh/article/details/54981823
from:https://www.cnblogs.com/vickystudy/p/11505936.html