Creating Patches from Drupal Merge Requests

Drupal.org has used patches to manage community contribution for many years. But, patches are difficult for new users to learn and require the use of the command line. Recently, Drupal.org code has migrated to Gitlab, and we can now use Gitlab and Drupal.org issues to create merge request to share code and fixes with modules and Drupal Core. But, how do you use the code on your site immediately?

Create a patch file and upload it to the issue on Drupal.org.

Patches from Forks

You can obtain the patch by adding .patch to the URL of a merge request. To get to the merge request, click on the merge request in the issue. Make sure to remove any # from the end of the URL. The URL should look like this:

https://git.drupalcode.org/project/easy_breadcrumb/-/merge_requests/5.patch

From there, save the file as a file named .patch and upload it to Drupal.org!