I’m using git to develop a project and each machine may need a slightly different .htaccess file. I wonder if there’s any technique to handle versioning this file without having a separate one on each machine?
Basically I have something like that in mind (pseudo-code):
<MachineX>
RewriteBase /somepath/
</MachineX>
<MachineY>
RewriteBase /anotherpath/
</MachineY>
<Production>
RewriteBase /prodpath/
</Production>
Basically, each machine can have their custom code in .htaccess if needed. Any suggestion?
One possibility is to have a template
.htaccessfile in your main branch, saymaster.Then you create a branch from
masterfor each machine and commit modifications to this file on this specific branch.And when you want to integrate changes from
masterinto that branch, just switch to it and merge withmaster.