git更换远程仓库
方法一:不删除远程仓库修改
# 查看远端地址
git remote -v
# 查看远端仓库名
git remote
# 重新设置远程仓库
git remote
set
-url origin https:
//gitee.com/xx/xx.git (新地址)
方法二:删除远程仓库修改
# 查看远端地址
git remote -v
# 删除远程的仓库
git remote rm origin
# 重新添加远程仓库
git remote add origin https:
//gitee.com/xx/xx.git(新地址)
方法三:修改.git文件夹里的config配置文件
打开项目目录下隐藏文件夹.git下的config文件内容,将 [remote “origin”] url 修改成你需要替换的新地址:
[core]
repositoryformatversion = 0
filemode =
false
bare =
false
logallrefupdates =
true
symlinks =
false
ignorecase =
true
[submodule]
active = .
[remote
"origin"
]
url = https:
//gitee.com/xx/xx.git(新地址)
fetch = +refs/heads/*:refs/remotes/origin/*
[branch
"master"
]
remote = origin
merge = refs/heads/master