Skip to content

Instantly share code, notes, and snippets.

@jezman
Created October 1, 2018 12:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jezman/a6c9a6c93f651b8b84ac6e08303e82ed to your computer and use it in GitHub Desktop.
Save jezman/a6c9a6c93f651b8b84ac6e08303e82ed to your computer and use it in GitHub Desktop.
Create blank repo on github via bash
#!/usr/bin/env bash
curl -XPOST -H "Authorization: token $GITHUB_TOKEN"\
https://api.github.com/user/repos -d "{\"name\":\"$1\"}"
mkdir ~/github/$1
cd ~/github/$1
echo "# $1" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:jezman/$1.git
git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment