How Git works
After each complete step, the developer saves the changes as a commit – a bundle with a description such as "fix shipping cost calculation for Slovakia". The result is a full project history: when something changed, who did it and why. The code is usually also stored on a service such as GitHub, GitLab or Bitbucket, so it exists outside the developer's computer.
Git also lets you work in branches. A new feature is developed on the side and merged into the main version only once it is finished and tested. In the meantime, bugs on the live site can be fixed without any fuss.
Why it matters to you too
- Safe rollback. If a new version breaks something, the previous one can be restored in a few minutes.
- No dependence on one person. When you change developers, the new one gets all the code along with its history.
- Visibility. You know what you are being invoiced for and what actually changed on the site.
- A basis for automation. Automated deployment and testing plug into Git.
Git and WordPress
For a WordPress site, Git mainly holds the custom code – a bespoke theme and custom plugins. Content, orders and uploaded images live in the database and the media folder, which Git does not handle. For those you need regular backups. Git does not replace backups, it complements them.
A real example
A company with its own Laravel ordering system changed suppliers. The previous developer had uploaded changes straight to the server over FTP and the code existed nowhere else. Nobody knew which files were current or what had changed when. The new developer spent the first two weeks just finding their way around the code. With the project in Git, it would have taken days.
What to watch out for
- The code repository should be registered to your company, not just to the developer's personal account.
- Passwords and access keys do not belong in Git.
- When ordering a web application, ask whether the code is version-controlled and where it is stored.