Home ›
Creating a patch with Git suitable for submitting to Drupal.orgCreating a patch with Git suitable for submitting to Drupal.org
Revised now that Drupal is bending itself to the Git way!
Take the hash of a 'before' commit and the 'after' commit 'sha' hash and stay relative to the current directory and output a patch:
~/code/dgd7/drupal/sites/all/modules/views$ git diff --relative 5ac40a1 cb64d08 > 817748-views-book-hierarchy-sort-12.patch
Note: We no longer need --no-prefix because as git diff outputs patches with a/ and b/ prefixes and git apply expects them by default (though both can take a -p0 option), people not using git are expected to use patch -p1 which takes the a/ and b/ prefixes into account.
More like this
- Maintaining a module on Drupal.org with CVS: committing changes
- How to make patch files to contribute to contributed modules
- Creating views programmatically in Views 2 | drupal.org
- Fighting with Drupal.org's CVS: nothing known about module files and sticky tags not valid
- Sharing a complex Drupal patch for contributing to core, with git

