0

我在 GitHub 组织中有一个仓库。

它的代码取决于某些凭据。它基本上会查找一个名为 as 的文件environment.properties,该文件将包含一个 key-value 对 like env=pps,然后将继续读取一个名为 as 的文件pps-credentials.properties

我们希望在同一个组织中拥有另一个 repo,但保持相同的代码。这将部署到另一个云环境并读取环境文件并找到一对喜欢env=jkd然后读取jkd-credentials.properties.

这两个代码都将部署到不同的云环境中。

我们的要求是:

  1. 这个新的 repo 应该和旧的 repo 在同一个组织中
  2. 两个 repos 的代码应该完全相同
  3. 由于它在同一个组织中,它不能被分叉,但我们仍然需要能够将旧 repo 上所做的更改同步到新 repo。代码不会有任何更改,我可以保证
4

1 回答 1

1

If someone, such as you, has a local copy of this repo, you can give your copy two remotes, representing the two GitHub repos, and just keep them in sync manually by fetching from one and pushing to the other.

This actually is no different from how you keep a fork in sync with its original (upstream). You don’t need a GitHub fork to do that.

I actually do this as a way of having a backup copy of my company repo. If the company server goes down temporarily (it has happened sometimes) I still have my code and a place to push to.

于 2021-04-30T05:48:29.717 回答