背景
由于gitlab地址修改后导致本地仓库的远程仓库失效
解决办法
-
直接修改本地的远程仓库地址
- 进入项目地址git remote -v 查看旧地址
- 更新指令 git remote set-url origin newUrl
-
先删除后新增
- 删除旧地址 git remote rm origin
- 新增地址 git remote add origin newUrl
-
修改配置文件地址
- 进入项目.git文件夹下
- 编辑配置文件 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即可
以上
gitlab git仓库地址修改后更新方法
原文:https://www.cnblogs.com/LandWind/p/12996600.html