2. Essential Tools: Drush and Git


  • 2
  • This chapter introduces two essential tools in the life of any Drupalista: Drush, the Drupal Shell which makes many tasks in Drupal much faster and easier; and Git, a distributed version control system which allows you to experiment freely with your code— and to collaborate with people around the world.

    Whether building sites, developing themes or modules, or trying to make a Drupal distribution that can drive your car, Drush (the Drupal shell) and Git (an open source version control system) will help you get where you are going quickly and safely. This chapter will give you a brief overview of Drush and Git and then it will help you get started with these powerful tools.

    Drush is easy to explain. It lets you perform all manner of repetitive Drupal tasks much, much faster. Need to upgrade your code? Use drush up. Need to download a new module? Use drush dl MODULE_NAME. Drush does the rest of the work—usually within a minute or two.

    Git may be a little harder to explain. The short explanation is that if you are not using version control, you need to. If you are the pesky type of person that expects reasons for doing things, here’s a slightly longer explanation: have you ever wanted an undo or rewind button for life? That’s version control. The best way to perform backups of your work is with a properly configured version control system (VCS), which you use constantly to record changes to a file or set of files over time so that you can revert to or compare specific versions later.