The following use case can occur when developing drupal: you want to patch a module, but it is a contrib module that is not in version control (it is ignored by git and gets downloaded on build). Therefore you can not use the standard GIT commands for creating a patch.


So, you would have to download the module separately, like:

git clone --branch 8.1.x

Then, you make the change and run the following:

git diff 8.1.x > colorbox-css-issue.patch

This creates a patch for this module. Now you can place the patch in a patches folder and add it to your composer.json file. Helpful source:



Saved you some valuable time?

Received 100 so far from 4 kind contributors.