O'Reilly logo

Drupal for Designers by Dani Nordin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Getting Started with Git

The reasons for using version control on your Drupal projects are several and various, and have only recently become clear to me, as I’ve started working with Drush and Git. Although adding version control to your workflow can be daunting at first, the benefits far outweigh the initial annoyances. Consider this:

  • In a recent project, while attempting to theme complex navigation on a Drupal 7 prototype, I found myself messing things up in a bad, bad way, less than an hour before major stakeholders were supposed to look at the site. Because we were using Git, I was able to roll back to the former, not-messed-up menu while we focused on other priorities—without having to make a frantic phone call to our developer.

  • When working with more than one person, version control allows you not only to figure out who made what changes to the code, but also to work on the same file at once without accidentally overwriting each other’s changes.

  • Finally, version control ensures that you have exactly the same files installed in all locations. This means you never have to worry that your local site is on a different version of a module than your server copy.

In this chapter we’ll install Git in our local development environment, set up a local and remote repository for a basic Drupal implementation, and learn how to work Git into our Drupal workflow.

Master Versus Origin

Git allows multiple development tracks to be going on simultaneously, using a technique called branching ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required