git修改远程仓库地址有三个方法
- 通过git bush命令直接修改
git remote set-url origin [url]
如
git remote set-url origin https://github.com/GoWith/apiCheck.git
- 先删除原有仓库地址,然后添加新地址
git remote rm origin
git remote add origin [url]
如
git remote rm origin
git remote add origin https://github.com/GoWith/apiCheck.git
- 修改配置文件
vim config
[core]
repositoryformatversion = 0
filemode = true
logallrefupdates = true
precomposeunicode = true
[remote "origin"]
# 修改成新的仓库地址
url = https://github.com/GoWith/apiCheck.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master