Git workflow for Drupal.org issues
Inspired by chx's workflow http://drupal4hu.com/node/374, this is the workflow I used when working on multiple issues at the same time to rename Views functions.
This workflow worked for me. YMMV.
Starting out:
git clone --branch 8.x http://git.drupal.org/project/drupal.git 8
# checkout all of Drupal into a directory called 8- Start working on an issue. Make commits on your work. Since you likely don't have commit access to the Drupal project, you won't break anything for anybody else.
- Oops, I forgot to make a branch for this 'feature'. Good thing there's
git checkout -b
. Using https://drupal.org/node/2002348 as an example:
git checkout -b 2002348-rename-advanced_render
- Do you have git completion setup? I'm thinking maybe you should have git completion setup.
- Make a patch based on the current branch you're on. This creates a patch with the branch name.
git diff 8.x > $(git rev-parse --abbrev-ref HEAD).patch
- On a Mac, you'll still need to attach the file.
open -R $(git rev-parse --abbrev-ref HEAD).patch
# will open finder at the location of the patch you created- then in the issue, click "Choose File", then drag and drop the patch from Finder into the dialog box.
Later on, when you need to re-roll:
git checkout 8.x
git pull
git checkout 2002348
[TAB] # that is, paste in the issue number, then press the TAB button to tab complete, since you probably forgot what the human-friendly part of the branch titlegit merge 8.x
- Same as step #5 above.
- Same as step #6 above.