Git

The version control tool behind Drupal.org's projects: it tracks source code changes, and GitLab at git.drupalcode.org adds the web interface.

Learn DrupalDrupal glossary Last updated

Git is a version control tool that stores the changes to a set of files as a history you can go back through. Drupal core, contributed modules and themes keep their source code in Git repositories. A developer working on a Drupal site or on a fix uses Git to save work, compare versions and share changes with others.

How Git works in Drupal 11

Git is a distributed version control system. A clone is not just the latest files; it mirrors the repository, including its full history. Git stores data as snapshots: at every commit it records what all the files look like, and for an unchanged file it keeps only a link to the earlier identical copy. Most operations need only local files, and everything is checksummed, so Git notices when content changes.

A file passes through three states. It is modified when you changed it but did not commit it, staged when you marked it for the next commit, and committed when it is safely stored in the local database. A commit takes the files as they are in the staging area.

The Drupal.org documentation says the project uses Git to track changes to project source code and GitLab to provide the web interface. Each project has a separate repository at git.drupalcode.org. The rest of the workflow runs through issues: an issue fork is a temporary repository for the work on that issue, and anyone in the community can commit and push to it. The change travels back as a merge request.

Example

You fixed a bug in a custom module and also changed a tracked settings file for a local test. Only the fix belongs in the commit:

git status
        git add web/modules/custom/mymodule/mymodule.module
        git commit -m "Fix the empty title on the teaser"

git status lists both files as modified. git add stages the module file, and git commit stores the staged snapshot. The settings file stays modified and out of the commit.

Common mistakes

  • Believing Git stores differences only. Git stores snapshots and links unchanged files to their earlier copy.
  • Expecting a commit to show up on Drupal.org. A commit is stored in your local database. Others see it only after you push it, for example to the issue fork.

For marketing and content teams

You will meet Git in two places. The Drupal core project page links its commit log, at git.drupalcode.org/project/drupal/-/commits. Merge requests are attached to issues, and an issue shows its status. Both show what changed in the code without you having to read it. When a developer mentions a change, ask for the issue link.

Sources

Questions about Git

Create an issue fork with the Create issue fork button below the issue summary on Drupal.org, commit your work there and open a merge request. Drupal.org describes merge requests as the recommended way to contribute source code changes.

No. Git is the version control tool that tracks the changes. Drupal.org says it uses GitLab software to provide a web interface to Git and other features; its GitLab guide covers merge requests and GitLab CI.

Cite this definition

"Git." DXPR Drupal glossary, https://dxpr.com/hc/documentation/learn-drupal/drupal-glossary/git. Last updated October 26, 2026.

Related terms

All Drupal terms from A to Z