Last updated March 14, 2011. Created by Damien Tournoud on November 23, 2008.
Edited by gapple, scor, moshe weitzman, ksenzee. Log in to edit this page.
First you need to install Stacked Git.
Fetching the Drupal repository
$ stg clone git://git.drupal.org/project/drupal.gitThis actually fetches the whole Drupal history, including all branches and tags, not only a copy of HEAD. So you can disconnect, and do all your work offline.
Creating a patch
You are now ready to manage your patch series. By convention, use this naming pattern: [nid]-[brief-description].
The generic procedure is:
// Tell Stacked Git you want to create a new patch.
$ stg new <your patch name>
// Make your modifications in the tree. `stg show` will show your diff
// ...
// Tell Stacked Git to refresh the patch (ie. to commit the modifications you made in the patch).
$ stg refreshManaging patch series
stg seriesShow the full patch series.
stg push [<patch name>]Apply one patch from your series in your working copy.
stg pop [<patch name>]Unapply one patch from your working copy.
stg sink [<patch name>]Sink a patch (move it down in the series).
stg float [<patch name>]Float a patch (move it up in the series).
Updating your patches from upstream
stg pullWill update your repository and all the patches in your series. Some modifications may conflict, and you will have to resolve those yourself (stacked git is great, but can't read your mind).
Exporting patches for Drupal
stg export -p -O --no-prefixWill create a patches-<branch name> directory with all your patches, and a nice series file.