News

GitHub’s ‘Hub’ command-line tool makes using git easier

2 min read

GitHub introduced ‘Hub’ that extends git command-line with extra functionality to enable developers complete their everyday GitHub tasks right from the terminal. Hub does not have any dependencies, but as it is designed to wrap git, it is recommended to have at least git 1.7.3 or newer. 

Hub provides both new and some extended version of commands that already exist in git. Here are some of them:

  • hub-am: Used to replicate commits locally from a GitHub pull request.
  • hub-cherry-pick: Allows cherry-picking a commit from a fork on GitHub.
  • hub-alias: Used to show shell instructions for wrapping git.
  • hub-browse: Used to open a GitHub repository in a web browser.
  • hub-create: Used to create a new repository on GitHub and add a git remote for it.
  • hub-fork: Allows forking the current repository on GitHub and adds a git remote for it.

You can see the entire list of commands on the Hub Man Page. Most of these commands are expected to be run in a context of an existing local git repository.

What are the advantages of using Hub

  • Contributing to open source: This tool makes contributing to open source much easier by providing features for fetching repositories, navigating project pages, forking repos, and even submitting pull requests, all from the command-line.
  • Script your workflows: You can easily script your workflows and set priorities by listing and creating issues, pull requests, and GitHub releases.
  • Easily maintain projects: It allows you to easily fetch from other forks, review pull requests, and cherry-pick URLs.
  • Use GitHub for work: It saves your time by allowing you to open pull requests for code reviews and push to multiple remotes at once. It also supports GitHub Enterprise, however, it needs to be whitelisted.

Hub is not the only tool of its kind, there are tools like Magit Forge and Lab. Though developers think that it is convenient, some feel that it increases GitHub lock-in. “While it is pretty cool, using such tool increases general lock-in to GitHub, in terms of both habits and potential use of it for automation of processes,” user expressed its opinion on Hacker News

Another Hacker News user suggested, “I wish there was an open standard for operations that hub allows to do and all major Git forges, including open source ones, such as Gogs/Gitea and GitLab, supported it. In that case having a command-line tool that, like Git itself, is not tied to a particular vendor, but allows to do what hub does, could have been indispensable.

To know more in detail, check out Hub’s GitHub repository.

Read Next

Pull Panda is now part of GitHub; code review workflows now get better!

Github Sponsors: Could corporate strategy eat FOSS culture for dinner?

Bhagyashree R

Share
Published by
Bhagyashree R

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago