Managing a private and public remote with different histories

笑着哭i 提交于 2021-02-11 07:43:36

问题


I have a project I would like to release in public.

It has a large history and many branches. I do not want to release that. There will be a dreaded, fat "initial commit" on the public repository.

I'm looking for a workflow that would allow me to:

  • develop my software in-house,
  • keep some parts of the software private, not to be released,
  • keep the whole history on the private repo,
  • release at will on a public repo (not necessarily with squashed, single commits per release, I'd probably keep the history "equal" from some point [1]),
  • accept pull requests on the public repo and eventually include them in my private one.

This is of course not suited well for git. I wonder what are my option to keep it as error-free as possible and scriptable.

I think there might be an option to go with patches and manual application. The problem is the selection of patches - how to ensure I upstream only things I want to without manually picking the commits?

It also sounds like a trade-off between cumbersome small releases or occasional releases with an awful lot of work to pick the correct commits.

Are there any standardized approaches to my problem?

[1] "equal" in the sense of same commit messages and content.

来源:https://stackoverflow.com/questions/33156559/managing-a-private-and-public-remote-with-different-histories

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!