One of the first questions I asked when taking over the development team was “What do you use for version control?” The answer came back – “we don’t use version control”. Instead, a every new version of each application was uploaded into a new directory on the production server, and then a constant in a config file was changed to tell PHP which directory of code to use.
To roll back, just change the value of the constant. Simple?
Not really. This approach gave no way of branching and merging, and one developer was likely to overwrite another’s changes.
After some cursory research, we decided to use Mercurial. All went well. Then, a contractor came in to help us and he insisted that we switch to using Git – we’ve used Git ever since.
I’d recommend the book “A Pragamatic Guide to Using Git” by Travis Swicegood (Pragmatic Bookshelf) to help get started with Git. I prefer command line tools, but for those that don’t there are plenty of GUI front ends for Git – such as TortoiseGit. PHPStorm has Git integration built it.
Once everyone in the team is using version control, you really have to adopt a branching strategy that works for your team. More on that in another post.
As an aside, a now ex-colleague was wrestling with something in Git (probably a fast-forward or some other esoteric feature) and was getting nowhere. In his temper, he blurted out “whoever wrote this Git thing obviously knows nothing about programming”.