Our company (internal projects) used version control (TFS, now 2015) for simply keeping an audit trail of released code - I have brought in the use of branching and merging and its completely changed the way we look at bottlenecks in the development pipeline and has generally been well received, but now I am looking for the next step.
Our code consists of one large piece of software and several other accompanying business applications.
We have four environments we keep up at all times, and our 'pipeline' is like so.
- Developer does work locally.
- Pushes code to a 'Development' environment (so we can all look at the code, see how well it integrates in the environment e.t.c)
- When testing is ready we push to 'Test' - this is code that has been approved to be moved up the pipeline and therefore the environment is a lot more stable than 'Development'.
- Next, we pass it to the UAT server, which is essentially a mimic of the live server, to be as stable and representative of a live release as possible. Code approved to move here is NOT frequent.
- Finally, production environments.
Now I simply took the approach of having a branch for each environment, allowing for easy compares, for people to quickly grab the source and whatnot, and to see the progression of the codebase up the chain.
MAIN -> STAGE -> TEST -> DEV
This is one single, linear line, and we can simply view the history of the MAIN branch to see all the different released builds.
From the dev branch we splinter off into our local branches, and any hotfixes come directly off the UAT branch.
This works for us - but it works in the sense a procedural program could work - it may not be the most effective approach. I'm just very curious as to whether there are better ways to do this, and after reading loads of stuff online I feel like people don't split their branches by environment but I don't really understand how that works better? Even though it is a pain to merge four times to release some code (although most of the time it is a rather slow pipeline, we have weekly releases).
Any help much appreciated.