GitHub: Creating Repositories and Opening/Closing Issues Entirely from the Terminal

You can delegate almost everything essential for git and github to the command line. There two obvious missing links: creating repositories and handling project issues. Here are two tools that allow you to complete these tasks.

Hub for creating repositories from the command line 

1. Install hub using brew with the command

brew install hub

2. Init your repository and do your first commit.

git init 
git add -A
git commit -m "First Commit"

3. Create the repository using Hub’s create command

git create -d "New Project"

4. It may ask you to log in with your GitHub credentials at this step

5. Push to your new repository!

git push origin master

GHI to handle GitHub issues from the command line

1. Install GHI using brew

brew install ghi

2. That’s it! Now you can use ghi to open, close, and edit your issues. Here’s a list of useful commands from the github page

usage: ghi [--version] [-p|--paginate|--no-pager] [--help] <command> [<args>]
           [ -- [<user>/]<repo>]

The most commonly used ghi commands are:
   list        List your issues (or a repository's)
   show        Show an issue's details
   open        Open (or reopen) an issue
   close       Close an issue
   lock        Lock an issue's conversation, limiting it to collaborators
   unlock      Unlock an issue's conversation, opening it to all viewers
   edit        Modify an existing issue
   comment     Leave a comment on an issue
   label       Create, list, modify, or delete labels
   assign      Assign an issue to yourself (or someone else)
   milestone   Manage project milestones
   status      Determine whether or not issues are enabled for this repo
   enable      Enable issues for the current repo
   disable     Disable issues for the current repo

See 'ghi help <command>' for more information on a specific command.



Leave a Reply

Your email address will not be published. Required fields are marked *