Git 重新关联远程仓库地址的三种方法
2019-07-30 本文已影响0人
WotYang
1.修改命令
git remote set-url origin [url]
例:git remote set-url origin git@github.com:yangsanning/StatusBarUtils.git
2.先删后加
git remote rm origin
git remote add origin [url]
例:git remote add origin git@github.com:yangsanning/StatusBarUtils.git
3.直接修改.git文件夹下的config文件
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[submodule]
active = .
[remote "origin"]
url = https://github.com/yangsanning/StatusBarUtils.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master