Skip to content

Instantly share code, notes, and snippets.

@eignatov
Forked from chrisross/curl_create_repo_github
Created December 11, 2017 10:42
Show Gist options
  • Save eignatov/de8eb6db4ae92a321f45ac3e995071cf to your computer and use it in GitHub Desktop.
Save eignatov/de8eb6db4ae92a321f45ac3e995071cf to your computer and use it in GitHub Desktop.
A set of shell commands to quickly remotely create a github repo, init/add all/commit in the current directory and push to the aforementioned remote. (using Github's Repo API v3 and cURL)
curl -u <username_here> https://api.github.com/user/repos -d '{"name":"curltest", "description": "testing description"}'
=> Enter passphrase:
// Example test case(below):
cd <local_repo_dir_path>
mkdir curltest
cd curltest
git init
touch curltest.txt
subl& culrtest.txt
git add .
git commit -m "Testing"
git remote add origin git@github.com:<username_here>/curltest.git
git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment