Skip to content

Instantly share code, notes, and snippets.

@jan-koch
Created May 22, 2019 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jan-koch/81086d0bd3189ccaf3691991b18f93ca to your computer and use it in GitHub Desktop.
Save jan-koch/81086d0bd3189ccaf3691991b18f93ca to your computer and use it in GitHub Desktop.
A simple bash script to create a repository from the console.
#! /usr/bin/bash
NAME=$1
TYPE=$2
echo "Creating the repository"
gh re --browser false --new "$NAME" --type "$TYPE"
mkdir "$NAME"
cd "$NAME"
echo "# $NAME" >> README.md
git init
git add .
git commit -m "📦 NEW: Initial commit"
git remote add origin git@github.com:USERNAME/$NAME.git
git push --set-upstream origin master
git push
echo ''
echo "DONE: https://github.com/USERNAME/$NAME"
echo ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment