Skip to content

Instantly share code, notes, and snippets.

@chrisross
Created April 28, 2013 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save chrisross/5475951 to your computer and use it in GitHub Desktop.
Save chrisross/5475951 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