Skip to content

Instantly share code, notes, and snippets.

@gabrieljoelc
Last active December 20, 2015 19:48
Show Gist options
  • Save gabrieljoelc/6185434 to your computer and use it in GitHub Desktop.
Save gabrieljoelc/6185434 to your computer and use it in GitHub Desktop.
CLI commands for github API v3 (replace all CAPS keywords). Ripped off from http://stackoverflow.com/a/10325316/34315.
Invoke-RestMethod -Uri https://api.github.com/user/repos `
-Body (@{"name"="REPO"} | ConvertTo-Json) `
-Credential 'USER' `
-Method Post `
git remote add origin [email protected]:USER/REPO.git
git push origin master
curl -u 'USER' https://api.github.com/user/repos -d '{"name":"REPO"}'
git remote add origin [email protected]:USER/REPO.git
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment