修改已有git仓库的远程仓库指向

时间:2021-08-02 23:52:27
$ git remote set-url origin git@github.com:test/thinkphp.git

或者

$ git config -e

直接编辑其中origin的url就行了,退出时记得保存

[core]
repositoryformatversion =
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://github.com/x/thinkphp.git
[branch "master"]
remote = origin
merge = refs/heads/master