Getting Started with Git

Draft (work in progress) -- AWAITING PEER REVIEW
This lesson will introduce you to Git and provide resources you can use to become more familiar with Git.

This lesson provides a basic overview of Git as well as some helpful links.


Why Git?

  • Version control: Drupal contributors work constantly to modify and improve Drupal's code. Code may become incompatible as other developers add patches and modifications. Every modification in Git is known as "commit". Git keeps "snapshots" of the state of each file at each "commit".
  • Local operations: Developers work on local versions of their code. Git doesn't have the network overhead, and developers can code on their local database.
  • It's hard to screw up. Most actions done in Git are undoable.

Git architecture--3 sections of a project:

  • Working directory: single local "snapshot" or "checkout" of the project state. These files are located in your local database, and this is what you modify.
  • Staging area: a file containing information about the modifications you made that you intent to save or "commit" to your Git directory.
  • Git directory: Where Git stores all the data for your project. This is what is copied when you clone from the Internet.

Check out the main Drupal Ladder Git lesson:

  1. GitHub's Git tutorial (interactive):
  2. Git Branches tutorial (interactive):
  3. The ProGit book (free!):


indyana's picture

I was initially disappointed that the lesson only contained links, but the interactive tutorials turned out to be fun. I would suggest a bit more explanation for each of the steps to let users know what they are getting into.

Since most people will be coming back to this page, it would be nice if the steps would open in a new window/tab (target=_blank), rather than forcing them to come back to the site or paw through their history list.

Its not clear if those steps are mandatory, and if so, should they be performed in order, or in any order. Perhaps a bit of an explanation that the "following three steps" need to be performed in order. Or just put them in an ordered list.

Additionally, there's no indication that the system feels the steps have been completed - or is the view/user supposed to check off those boxes manually?

Because this lesson is nothing more than links to external resources, shouldn't it be moved to prerequisites?