Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.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_Version Control_Github_Repository - Fatal编程技术网

如何组合两个独立的git存储库

如何组合两个独立的git存储库,git,version-control,github,repository,Git,Version Control,Github,Repository,我在本地服务器上有一个web项目的本地副本。一切都好。使用git和github 但是,我在另一台服务器上拥有(几乎)相同的存储库。问题是回购协议是用自己的gitinit命令初始化的,因此这两个回购协议是分开的 有没有办法同步这些 我已经成功地使用了它 git remote add upstream git://another-server.com/repo.git git fetch upstream git merge upstream/master 我已经成功地使用了它 git remot

我在本地服务器上有一个web项目的本地副本。一切都好。使用git和github

但是,我在另一台服务器上拥有(几乎)相同的存储库。问题是回购协议是用自己的
gitinit
命令初始化的,因此这两个回购协议是分开的


有没有办法同步这些

我已经成功地使用了它

git remote add upstream git://another-server.com/repo.git
git fetch upstream
git merge upstream/master

我已经成功地使用了它

git remote add upstream git://another-server.com/repo.git
git fetch upstream
git merge upstream/master
这可能会有帮助:这可能会有帮助: