Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
合并的git远程设备在单个远程设备上不可见_Git_Github_Bitbucket_Git Remote - Fatal编程技术网

合并的git远程设备在单个远程设备上不可见

合并的git远程设备在单个远程设备上不可见,git,github,bitbucket,git-remote,Git,Github,Bitbucket,Git Remote,为了将更改推送到两个独立的存储库,我采用了以下git远程配置(灵感来源于): 在我在某处创建新的克隆之前,这一切都很好: git clone git@bitbucket.org:sgrodzicki/test.git 克隆配置只有一台主机: [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = git@bitbucket.org:sgrodzicki/test.git 另一个存储库(GitHub

为了将更改推送到两个独立的存储库,我采用了以下git远程配置(灵感来源于):

在我在某处创建新的克隆之前,这一切都很好:

git clone git@bitbucket.org:sgrodzicki/test.git
克隆配置只有一台主机:

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@bitbucket.org:sgrodzicki/test.git
另一个存储库(GitHub)也是如此:

然后看起来是这样的:

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@github.com:sgrodzicki/test.git

我的问题是:如何使这些配置更改在两台主机上都可见?

远程设备的配置不是克隆的信息的一部分-与git目录中的许多内容一样,它被视为私有信息

您只需在每个存储库中执行以下操作:

git remote set-url --add origin git@github.com:sgrodzicki/test.git
。。。克隆之后

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@github.com:sgrodzicki/test.git
git remote set-url --add origin git@github.com:sgrodzicki/test.git