公司搬移, 做为git仓库的服务器IP地址变了。 本地代码挺多,从新检出太占时间,能够修改一个什么配置让我本地仓库和新的远程仓库创建关联吗, 答案是确定的!git
如下均以项目git_test为例:
老地址:http://hostname/**/**.git
新地址:http://hostname/**/**.git
远程仓库名称: originvim
vim config
服务器
[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便可fetch
以SourceTree为例,点击 仓库 -> 仓库配置 -> 远程仓库 便可管理此项目中配置的全部远程仓库, 并且这个界面最下方还能够点击编辑配置文件,一样能够完成方法三。url