How do I ensure my developments are put into some form of source control? Kind of like working with GIT/GITHUB. Any approaches to doing this?
Whats the best way to do source control while developing on a Matrix project?
You have rollback in Matrix and have the ability to view the history and view older versions of your content save. As for your CSS/JS, you can manage this with GIT/GITHUB.
Similar to the approach tbaatar mentioned we do this in Squiz. For designs and all their associated files (CSS, JS, Images, HTML) we store them in external to the Matrix system in Git repositories. For anything content related we rely on Matrix rollback and backup systems. There are some asset types that mix code & configuration that require a bit of special attention. These might be JS REST assets or DB Data Source and their are either managed by manually storing their code in Git, or by exporting the asset to XML using Matrix export functionality and putting the XML in Git.
How do you keep your GIT repository in sync with associated assets in Matrix? Is it a manual process or do you automate the deployment of changes?
How do you keep your GIT repository in sync with associated assets in Matrix? Is it a manual process or do you automate the deployment of changes?
While there are tools that do allow us to push content into a Matrix system (e.g. SOAP interface) I find that most of the change occurring to the files that sit in Git are design related and not prone to constant change (usually bursts of change as the design goes through different phases over the years). Keeping them in sync manually is usually fine so long as all developers are aware of the repository and have access to it. There is also an added danger of automatically uploading change into Matrix if it's likely someone might change the asset via the editing interfaces. You may find changes get overwritten or lost and just general confusion and all of the advantage you had of automatically publishing changes from Git is gone.
There are some very complex projects Squiz has been involved with where (during development) instead of publishing to a Matrix asset the JS, CSS & Image files sit in a static file system and are served from there rather than as Matrix assets. When it's tested and ready for production these may be uploaded as Matrix assets, or they may be left in place if there is a backup strategy. This approach isn't for everyone as it requires a good deal more technical knowledge, access to the server and is more suited to large custom applications with multiple developers.