GitHub on the Command Line [Snippet]
"Hub" is a command-line client for GitHub used to manage issues, pull requests, and conveniently fork or check-out repositories.
Join the DZone community and get the full member experience.
Join For Free
The command "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.
You may also like: Git Vs. GitHub: Demystifying the Difference
I frequently use the following commands:
-
hub clone <org>/<repo>
-
hub browse
andhub 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/bug_report.md
Furthermore, you can set up 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 main page for more examples.
All opinions are my own and do not reflect those of my employer or colleagues.
Further Reading
Published at DZone with permission of Sebastian Daschner. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
SRE vs. DevOps
-
Automating the Migration From JS to TS for the ZK Framework
-
Chaining API Requests With API Gateway
-
5 Key Concepts for MQTT Broker in Sparkplug Specification
Comments