Skip to main content

Quickly creating github pull requests from the command line

An article from ComputerMinds - Building with Drupal in the UK since 2005
2nd Mar 2018

Mike Dixon

Senior Mind
Hey, you seem to look at this article a lot! Why not Bookmark this article so you can find it easily in the future?

Following on from my feature branching bash script I thought I would do another quick post about a super handy tool I use to streamline my dev workflow a little more (marginal gains and all that).

Hub is a command line tool that lets you do all kinds of clever github stuff without ever having to open a browser.  

All the setup instructions are here https://hub.github.com/ - it's pretty simple to get working (if I can do it ...).  I wasn't quite brave enough to alias my git command so I skipped that bit!

So my workflow now looks something like this 

go 12345-my-fix

<do some code changes>

git commit ...
git push

hub pull-request -b production -m 'My PR message'

Which results in a PR all setup in github, all ready for peer review.  Win!

Hi, thanks for reading

ComputerMinds are the UK’s Drupal specialists with offices in Bristol and Coventry. We offer a range of Drupal services including Consultancy, Development, Training and Support. Whatever your Drupal problem, we can help.