To display the PR number of your current branch, you can run:

$ hub pr list -f "%I%n" -h "$(git rev-parse --abbrev-ref HEAD)"
12345

It’s handy if you are working on multiple feature branches. Also, if your Heroku apps are named with Github PR numbers, this command can help to programmatically figure out the app’s name.

This command is based on hub extension. For Mac users, you can install with

$ brew install hub

Email Newsletter

I write about code and entrepreneurship. Sign up and get my updates straight to your inbox!



Junji Zhi

Senior Software Engineer.