Git 重新关联远程仓库地址的三种方法

1.修改命令

git remote set-url origin [url] 

例:git remote set-url origin [email protected]:yangsanning/StatusBarUtils.git

2.先删后加

git remote rm origin 
git remote add origin [url]

例:git remote add origin [email protected]: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

你可能感兴趣的:(Git 重新关联远程仓库地址的三种方法)