如何同步多个 git 远程仓库

在本地 git 仓库里找到这个文件 .git/config, 内容如下:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "gitee"]
        url = https://gitee.com/johng/gf.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[remote "origin"]
        url = https://github.com/gogf/gf
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master

改为如下:

合并 2 个 remote 配置

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = https://github.com/gogf/gf
        url = https://gitee.com/johng/gf.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master

 

 

 

 

 

 

 

 

 

 

 

Leave a Reply

Your email address will not be published.