More Git/Hub Workflow Experiences

After posting about my first Git/Hub workflow experiences, I got lots of helpful input from various folks, particularly Erik Vold, Irakli Gozalishvili, and Brian Warner, which led me to refine my process for handling pull requests:

  1. From the “how to merge this pull request” section of the pull request page (f.e. pull request 34), copy the command from step two, but change the word “pull” to “fetch” to fetch the remote branch containing the changes without also merging it:

    git fetch https://github.com/toolness/jetpack-sdk.git bug-610507

  2. Use the magic FETCH_HEAD reference to the last fetched branch to verify that the set of changes is what you expect:

    git diff HEAD FETCH_HEAD

    (The exact syntax here may need some work; HEAD..FETCH_HEAD? three dots?)

  3. Merge the remote branch into your local branch with a custom commit message:

    git merge FETCH_HEAD --no-ff -m"bug 610507: get rid of the nsjetpack package; r=myk"

  4. Push the changes upstream:

    git push upstream master

I like this set of commands because it doesn’t require me to add a remote, I can copy/paste the fetch command from GitHub (being careful not to issue the pull before I change it to a fetch), and I always type the same FETCH_HEAD reference to the remote branch in step three.

However, I wish the merge commit page explicitly referenced the specific commits that were merged. It does mention that it’s a branch merge, it isn’t obvious how to get from that page to the pages for the commits I merged from the branch.

git log --oneline --graph“, gitg, and gitk do give me that information, though, so I’m ok on the command line, anyway.

[More discussion can be found in the discussion group thread.]

 

Myk Melez

Myk is a Principal Software Architect and in-house entrepreneur at Mozilla. A Mozillian since 1999, he's contributed to the Web App Developer Initiative, PluotSorbet, Open Web Apps, Firefox OS Simulator, Jetpack, Raindrop, Snowl, Personas, Firefox, Thunderbird, and Bugzilla. He's just a cook. He's all out of bubblegum.