如何克隆公共存储库,将其设为私有并不断从公共存储库获取更新?

问题描述:

我将尝试解释这种情况...

I will try to explain the scenario...

存储库A是公共的(github).我创建了一个私有的存储库B(bitbucket).

Repository A is public (github). I created a Repository B (bitbucket), which is private.

存储库B为空.我想首先将所有东西从回购A转移到回购B.

Repo B is empty. I want to get all stuff from Repo A to Repo B at first.

然后,我将开始在回购B上工作,仅对回购B进行拉取/提取.

Then I will start to work on Repo B, making pull/fetch on Repo B only.

但是有时我想从回购A中获取东西,以防有新东西出现.

But from time to time I want to fetch from Repo A in case there are new stuff.

那怎么可能?我确实阅读了有关复制存储库的git文档,但我只是不明白.

How is that possible? I did read git documentation about duplicating a repository but I just don't get it.

谢谢

这听起来像是非常好的问答,

This sounds like a variation on the Integration-Manager Workflow. There's a very good question and answer about how to do this all on GitHub already that might be enlightening as well.

您的存储库A(GitHub)是此图中受祝福的存储库.您的存储库B(Bitbucket)是此图中开发人员公共存储库之一.您计算机上的本地存储库是此图中的开发人员专用存储库之一.

Your repository A (GitHub) is the blessed repository in this picture. Your repository B (Bitbucket) is one of the developer public repositories in this picture. The local repository on your computer is one of the developer private repositories in this picture.

在日常工作流程中,您将与本地存储库相对应地从存储库B推入和拉出.有时,您会从存储库A中提取/获取信息,决定如何将新提交集成到本地存储库中,然后将新提交从本地存储库中推送到存储库B中.

In your day-to-day workflow you'd push to and pull from repository B against your local repository. Occasionally, you'd pull/fetch from repository A, decide how to integrate the new commits into your local repository and then push the new commits from your local repository to your repository B.

当您准备回馈原始项目时-如果有的话,可以将存储库B公开,然后向项目维护者发送请求,其中包含您打算合并的内容的详细信息.

When you're ready to contribute back to the original project—if ever, you'd make repository B public and then send a request to the project maintainer with the details of what you propose to have merged in.