Backend and Infrastructure

Applying and Creating Patches with Git

This page is archived

We're keeping this page up as a courtesy to folks who may need to refer to old instructions. We don't plan to update this page.

Alternate resources

Drupal now uses Merge Requests.

Sprout Video


This tutorial takes a look at applying a patch from to your local copy of a module or Drupal core using Git. Afterwards we'll look at how you can create your own patches, using git diff and git format-patch, in order to contribute code back to Drupal or any of the module's on You can see a full Git workflow using GitHub in the lesson Git Workflow: Putting It All Together.

Additional resources