Using Git with Caché Studio

Using Git with Caché Studio is unfortunately not as easy as it should be. Also, depending on your current development process and environment set up you may run into further difficulties. An example of this is where your development team shares, and actively develops on, the same Caché instance.

The problem is basically down to the fact that with this set up, the Caché Studio source files – the files the developers see in their editor – are shared among all developers. In the git world, this can’t work. Each developer must have their own sandbox development environment were the changes that they make are in isolation from the changes other developers are making.

A good analogy is a HTML project hosted on a FTP server, where developers of the project actively develop on the FTP server rather than on their local machines. Clearly this set up is destined for concurrency issues where one developer’s changes could overwrite another developer’s changes.

The solution is to provide a sandbox development environment to each developer, either by providing developers with their own Caché instance, or by creating additional namespaces on the development instance – one namespace for each developer, this allows them to work on their code in isolation. The latter may also be the only option depending on the coupling between the project code and any existing source code.

When using this technique you should be aware of a shift in responsibility. Previously Cache Studio was the owner of the source code and project. However when you use git, and apply the changes mentioned in this post, the owner of the source code becomes Git. So it is the files on the file system that reflect the project source code, not the files in Studio – these files now reflect your working copy of the project, not the actual project.

With this set up deployment is simply a case of calling git pull on the project and then importing the project files into Studio. All of this can even be automated.

I’ve developed a very simple plugin for Cache Studio that helps automate the import/export process. It’s still in its infancy but it can be found on my git hub page for anyone interested: https://github.com/KarlPurk/cache-studio-esc