Git and Mountee
Mountee is a drive just like any other allowing you to track changes with Git.
Because Mountee is a ‘virtual’ drive, you can’t git init in the normal way, because you can’t write non-template files to the drive. You have to create your git repository outside the Mountee drive.
A non-bare repository with ‘detached’ working tree
This might sound complicated but all you need to do is specify two options when initialising your git repository:
- —git-dir indicates the (absolute) path to the git repository.
- —work-tree indicates the (absolute) path to the ‘detached’ working tree (in this case the Mountee drive).
Ensure you’ve mounted your site in Mountee, then initialise your new git repo:
git --git-dir=/Users/username/Sites/repos/hellomountee.git --work-tree=/Volumes/hellomountee.com/ init
In this case, I’ve made a repos directory in ~/Sites where I store any detached git repositories, but you can choose whatever —git-dir you like. Your —work-tree will always be the Mountee drive in /Volumes/.
Submodules and deployment
Obviously your templates aren’t the only elements in an EE project, so we’re currently exploring using Git Submodules to include your templates repo as part of your larger project. We are working through how this might work when it comes to deployment and we hope to have some further details available in this article soon.
If you’ve any feedback, thoughts or ideas on using Git with Mountee, we’d love to hear from you.