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:

1
hub issue create --edit -F .github/ISSUE_TEMPLATE/bug_report.md

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.

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.
Subscribe
Notify of
guest

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

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to top button