Member-only story

Create Git Repos From the Command Line + Push Your Code in one Command

Using a small extension to the Github CLI called Hub.

Alex Z
1 min readSep 13, 2020
because no one cares if you don’t have a picture. credit unsplash.

Three steps and you are off and running.

  1. Download Homebrew for Mac OS
  2. Download Hub for Github
  3. Run the script below (copy and paste into your terminal of choice)

Why

If you are like me, you like to track all your personal projects and files in source control. If you are in a workflow where you need to create new repos frequently it’s kind of a pain to have to keep switching in and out of command line and the git website.

What it does

The script above will take the following steps for you:

  1. Create the local git repo
  2. Create the remote Git Repo
  3. Connect the two repos
  4. Commit your code
  5. Move all your code to the remote branch
  6. Open the browser to your new remote repo, with code inside

The resulting repository:

Thanks for reading!

~ Alex Zito-Wolf

--

--

Alex Z
Alex Z

Written by Alex Z

Software Developer + Product Manager. Interested in Travel, Culture, Economics and the Internet. Join Medium: https://tinycode.medium.com/membership

No responses yet