Software Development

GitHub on the command line

hub is a command line client for GitHub. You can use it to view or create issues, pull requests, conveniently fork or check-out repositories, and much more.

I frequently use the following commands:

  • hub clone <org>/<repo>
  • hub browse and hub browse -- issues which opens in the browser
  • hub pull-request
  • hub issue create

Hub is repository- and branch-aware and the commands usually work as expected. It works with both the public GitHub and GitHub Enterprise. If the GitHub repository defines templates for issues or pull requests, you can use them similar to the following:

hub issue create --edit -F .github/ISSUE_TEMPLATE/

Furthermore, you can setup an alias for git that redirects to hub, since hub wraps all normal Git commands as well.

Have a look at the website or the man page for more examples.

Some of the content of this post was reposted from my newsletter issue 035.

Published on Java Code Geeks with permission by Sebastian Daschner, partner at our JCG program. See the original article here: GitHub on the command line

Opinions expressed by Java Code Geeks contributors are their own.

Want to know how to develop your skillset to become a Java Rockstar?

Join our newsletter to start rocking!

To get you started we give you our best selling eBooks for FREE!


1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

6. Spring Interview Questions

7. Android UI Design


and many more ....


Receive Java & Developer job alerts in your Area

I have read and agree to the terms & conditions


Sebastian Daschner

Sebastian Daschner is a self-employed Java consultant and trainer. He is the author of the book 'Architecting Modern Java EE Applications'. Sebastian is a Java Champion, Oracle Developer Champion and JavaOne Rockstar.
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments
Back to top button