在 gith/github 中创建新的 SW 变体时,我们应该创建一个新的分支还是一个新的存储库?

发布于 2025-01-12 16:45:26 字数 256 浏览 2 评论 0原文

我正在开发嵌入式软件,该项目现在有一个新的变体,它共享大约 90% 相同的代码,但将来不能合并回去。

那么我应该在旧存储库中创建一个新分支,还是为新变体创建一个新存储库?

更多背景信息:这两个变体应具有相似的要求,对于某些模块来说它们是完全相同的,而少数模块则不然。
当新功能出现时,可能会在不同的变体上有所不同或有不同的实施时间表。

我想要获得的是,两个变体上的类似代码更改可以重用/共享,这意味着不必编写相同/相似的代码两次。不确定这是否可能。

I am developing the embedded SW, and the project now has a new variant which share about 90% same code but can not be merged back in the future.

Then shall I create a new branch in the old repo, or just create a new repo for the new variant?

And more background: the 2 variants shall have similar requirements, for some modules they are totally same, few modules are not.
And when new feature comes, may diff on different variant or have different implementation schedules.

What I want to obtain is that similar code changes on 2 variants can be reused/shared which means do not have to write the same/similar code twice. Not sure if this is possible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡淡離愁欲言轉身 2025-01-19 16:45:26

我想要获得的是,两个变体上的类似代码更改可以重用/共享,这意味着不必编写相同/相似的代码两次

理想情况下,公共代码可以在其自己的存储库中隔离,然后引用为子模块

  • 原始存储
  • 库新存储库“新变体”

这样,您可以在公共代码存储库中进行演变并快速更新每个项目存储库。

What I want to obtain is that similar code changes on 2 variants can be reused/shared which means do not have to write the same/similar code twice

Ideally, the common code could be isolated in its own repository, and then referenced as submodule in:

  • the original repository
  • the new repository for "new variant"

That way, you can make evolutions in the common code repository and quickly update each project repository.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文