Skip to content

Instantly share code, notes, and snippets.

@nemanjan00
Last active November 1, 2015 15:46
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 nemanjan00/a2167f3e33895148dbba to your computer and use it in GitHub Desktop.
Save nemanjan00/a2167f3e33895148dbba to your computer and use it in GitHub Desktop.
local USERNAME=""
local PASSWORD=""

githubrepo

githubrepo is CLI tool for creating GitHub repos in one line.

You can install it using bpkg or as a function.

To configure, copy .github.example and configure it.

githubrepo (){
source ~/.github
curl -u "$USERNAME:$PASSWORD" https://api.github.com/user/repos -d "{\"name\":\"$1\"}" ; git remote add origin git@github.com:$USERNAME/$@.git
}
source github
githubrepo $1
{
"name": "githubrepo",
"version": "0.0.1",
"description": "Create github repo",
"scripts": [ "githubrepo.sh", "github.sh" ]
}
git remote | xargs -L1 git push --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment