Introduction to Drupal Git

Last updated on
1 October 2020

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. Background information you will need:

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:

Top of project page with link to Version control highlighted

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 Browse code repository link in the sidebar links to a GitLab page where you can view source code, see the commits that revised the source code, and propose edits to the source code for the project. (The View commits link in the project sidebar page also shows a list of the recent commits.) You can also 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 Managers 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 links in sections above):

Tags

Help improve this page

Page status: No known problems

You can: