I am working in a company where, until now, I have been the only software developer. The software is a web-based customer portal running on LAMP. The environment consists of 3 versions of the software - dev (dev.example.ch), test (test.example.ch) and live (example.ch). All development work is done on the dev system - I work in PHPStorm and that is linked to the dev version on the server. The test version is for users to test out new features and fixes before they go live. Up until now I have managed putting new code to the test and live systems using Beyond Compare. Cherry-picking the elements that need to go across as necessary. Database sync has been done using Navicat.
Now there are 3 developers and so I have decided to implement Git but I have to admit I am struggling to get my head around the best approach, bearing in mind the needs of the company.
We need to keep the structure of test and live systems. When it comes to new features, these will be need to be signed off before being set live. Sometimes this will be a very quick process (e.g. same day), sometimes things will be on the test system for weeks, even months before being signed off and will go through numerous changes.
For the developers we each use PHPStorm as development tool and will be working on numerous different tasks at the same time - features, improvements and bug fixes. These will be assigned to us using Jira Software, which can automatically create branches in BitBucket. We currently have separate versions of a dev system (e.g. dev1.example.ch, dev2.example.ch and dev3.example.ch) so we can test our own work without seeing each others’ work. Each of these has its own URL, vhost and database.
How can I best set up our Git platform bearing in mind this structure?
One suggestion is that the live (production) system is the master branch, the test is a sub-branch of the master and then we have sub-branches from the test branch for development, but I’m not sure how well that works for tracking issues across the branches.
Another idea is the test branch is the master and the production is kept entirely separate.
I think the main points I am trying to figure out are:
- If there is a bug to fix (on the live). How would this work, when it would likely exist and therefore need fixing in all branches?
- How we manage issues across the test and live systems, bearing in mind that there will be some things in test for months and others for only hours.
- How we can work with our own dev platforms (dev1.example.ch, dev2.example.ch etc.) for our own testing purposes.
- How to handle database structure/data changes (MariaDB).
Finally, how can I migrate our current structure “as is” into Git. Currently there are separate folders and webspaces for each version (3x dev, 1x test, 1x live).
Any and all advice appreciated.