使用不同版本的项目的 Git 工作流程
我有一个网站最近分为两个独立的版本,它们具有根本的功能差异。我们称它们为:
example.com alternate.example.com
每个都有自己的 git 分支。
我想知道的是,当出现需要部署到网站的两个版本的新功能时,如何确保此更改不会覆盖备用版本中的关键差异?
简而言之,假设alternate.example.com 的index.php 文件运行与example.com 分支不同的数据库查询。后来,我们意识到index.php有一个安全漏洞需要修补。如果我在 example.com 分支上修补它并合并到alternate.example.com,那么alternate.example.com 就会失去区分数据库查询并变得与 example.com 完全相同。
这是正确的还是我做错了什么?
I have a website that recently split into two separate versions, that have fundamental functional differences. Let's call them:
example.com
alternate.example.com
Each has their own git branch.
What I'm wondering is, when a new feature comes out that needs to be deployed to both versions of the site, how do I ensure that this change will not overwrite the key differences in the alternate version?
Simply put, let's say the index.php file for alternate.example.com runs a different database query than the example.com branch. Later, we realize that index.php has a security hole that needs to be patched. If I patch it on the example.com branch and merge into alternate.example.com, then alternate.example.com loses that distinguishing database query and becomes exactly like example.com.
Is that correct or am I doing something wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要一个共同的祖先分支。
因此:
代码。 example.com 和alternate.example.com 只需添加各自的数据库查询即可。
因此,安全漏洞将在基础中修复,并合并/重新基于 example.com 和 alter.example.com 分支。
You need a common ancestor branch.
So:
Base would contain the index.php code common to both. example.com and alternate.example.com would simply add their respective database queries.
Thus, the security hole would be fixed in base and merged/rebased onto the example.com and alternate.example.com branches.