Is it possible with git, or any VCS, to maintain two versions of essentially the same software (a "free" version and a paid version) within one repository? I envision a master branch (maybe the "free" branch) and a paid branch in which I merge the "free" branch into.
I am not well versed in this area so my thinking and terminology may not be entirely accurate. I haven't tried this as even if it works, it may not be the best approach. Thanks!
Such business logic should be implemented in build strategy. Use git to keep two similar code base is a big NO NO.
Even in interpreted language like PHP you still need to build. Your code should not be available for use directly from source code. At least you need to compile CSS, Javascript etc for production mode. So build is a must.
Now comes your free and paid version. I don't know how you separate them. I suppose a better logic is through plugins or moduals. Paid version has more or better functions which could be done by including separate plugins or moduals.
So the logic is simple now:
- You keep a public repo to serve your free version.
- You keep a private repo for paid version, which include 1) Advanced plugin/moduals. 2) Build strategy to fetch free repo and compile paid version.