{{announcement.body}}
{{announcement.title}}

GitHub on the Command Line [Snippet]

DZone 's Guide to

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.

· Open Source Zone ·
Free Resource
"Hub" is a command-line client for GitHub used to manage issues, pull requests, and conveniently fork or check-out repositories.

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 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:

Java




x


1
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

Git Vs. GitHub: Demystifying the Difference

Global gitignore [Code Snippet]

Topics:
command line ,github ,shell ,hub ,code snippet

Published at DZone with permission of Sebastian Daschner , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}