简体   繁体   中英

Git workflow using disparate versions of a project

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?

You need a common ancestor branch.

So:

  • base
  • example.com
  • alternate.example.com

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM