Introduction to Drupal Git
Introduction
Most projects within the larger Drupal open-source software project and community have an associated source code repository, which is managed using the Git revision control system and GitLab software. This page describes how the Drupal project uses Git. Useful background information:
- Overview of Drupal projects and issues
- Wikipedia article on version control
- Wikipedia article on diff - Note that "patch" files, mentioned in many of the pages in the Git section, are in unified diff format.
- Pro Git book - Read chapter 1 and section 2.1 for necessary background knowledge for understanding this page.
- Git documentation home page - Links to videos that provide background knowledge, reference pages, and other documentation.
- GitLab documentation
The Additional Resources section at the bottom of this page has links to more documentation.
Project Git repositories
Each individual project within the larger Drupal project has its own, separate Git repository with its own branches and tags. From each project home page, such as the Admin Toolbar contributed module project page, there are two links related to Git:

The Version control tab (near the top of the page) links to a page that provides a command that anyone can use to clone the project's Git repository, and other helpful Git commands that are mostly used by project maintainers.

The Development section further down the page provides 3 links to the project's pages on Drupal's site on GitLab, git.drupalcode.org.
- Source code links to the project's home on GitLab.
- Commit log links to a list of commits on the project's default branch.
- GitLab activity links to a list of activity on the project, such as merge requests.
You can go directly to the GitLab page for a given project by visiting https://git.drupalcode.org/project/PROJECT_SHORTNAME, where PROJECT_SHORTNAME is the short name for the project (URL suffix of the project page).
Branches, tags, and releases
Project maintainers can create branches in the source code repository, corresponding to major and/or minor versions of the software. For versions compatible with Drupal core 8.8.x and later, projects are encouraged to use semantic versioning; for example, a project might have a 1.0.x branch. For versions compatible with older Drupal core software, the branch might be 7.x-1.x or 8.x-1.x.
Within each branch, project maintainers can create tags for individual software releases. Tags might be named 1.0.0 or 8.x-1.0, depending on the branch scheme being used. See the Git for Project Maintainers guide guide for more information.
Additional Resources
Here are some tools you might consider downloading:
- drupalorg-cli - A command-line tool that is very useful for dealing with Git, patches, drupal.org issues, and releases.
Here are some additional resources for learning more about Git (in addition to the links in the Introduction above):
- Understanding Git Conceptually - A very well written guide on the fundamentals of Git. It is nigh impossible to understand git without this guide.
- Git Ready - Great tutorial material that is very accessible.
- GitLab University - Everything you need to know about DevSecOps.
- "Change Management and Version Control" video series from Build a Module.com - Thorough video tutorials for using Git to manage a Drupal workflow.
- Git Immersion - Accessible tutorials.
- Git podcasts list
- Git Magic [GitHub repo] - An excellent, short tutorial on using Git, covering both basic and more advanced commands in a simple and useful way.
- Git for beginners: The definitive practical guide - A fairly comprehensive outline of links on Stackoverflow.com.
- List of Git documentation resources at kernel.org wiki.
- A successful branching model - Good reference dealing with branching and merging branches.
- GitHub Skills - Learn how to use GitHub, which is similar but not quite the same as the GitLab software we use to manage Git.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.