【git】git切换仓库

方法一、修改本地仓库地址

#进入项目根目录
git remote set-url origin [url]

方法二、通过命令先删除再添加远程仓库

#进入项目根目录
git remote rm origin
git remote add origin [url]

方法三、修改配置文件

#进入项目根目录/.git

$ 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
posted @ 2022-08-15 19:54  brucejiao  阅读(173)  评论(0编辑  收藏  举报