Skip to content

Instantly share code, notes, and snippets.

@joannakl
Last active January 13, 2019 01:06
Show Gist options
  • Select an option

  • Save joannakl/596bd46c10c29f645520b3058b264986 to your computer and use it in GitHub Desktop.

Select an option

Save joannakl/596bd46c10c29f645520b3058b264986 to your computer and use it in GitHub Desktop.

hub

hub is a package that adds additional functionalities to git workflow that purtain to GitHub specifically.

adding to Ubuntu

You can add hub to an Ubuntu system (16.04 or later) using a snap:

sudo snap install --classic hub

The hub command should be able to perform any task that you used to performing with git plus more.

Some people suggest then aliasing git to hub. You can do that, but not having that alias makes it easier to distinguish pure git from the added wrappers provided by hub.

creating a repository using hub

Here are the steps to create a repository wihtout ever going to the http://github.com website.

  • navigate to a directory that you want to be the root of your repository

  • run git init or hub init to initialize the repository

  • (optionally) add filed to the repository using git add ... or hub add ...

  • create the repository on GitHub one of the two ways:

    • run

      hub create 
      

      to create a repository in your own GitHub account with the name matching the name of the current working directory

    • run

      hub create ORG_NAME/REPO_NAME
      

      to create a repository in an organization to which you have wrie access (REPO_NAME should match the name o the current working directory)

  • (optionally) run git push origin master or hub push origin master to push the latest commit to the remote

Here is the help page for the hub create instruction:

usage: git create [-p] [-d DESCRIPTION] [-h HOMEPAGE] [NAME]

Create a new public GitHub repository from the current git
repository and add remote origin at "[email protected]:USER/REPOSITORY.git";
USER is your GitHub username and REPOSITORY is the current working
directory name. To explicitly name the new repository, pass in NAME,
optionally in ORGANIZATION/NAME form to create under an organization
you're a member of. With -p, create a private repository, and with
-d and -h set the repository's description and homepage URL, respectively.

Other hub instructions

To learn more about other instructions on hub run hub help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment