Skip to content

Instantly share code, notes, and snippets.

@lsegal
Created September 22, 2010 19:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lsegal/592328 to your computer and use it in GitHub Desktop.
Save lsegal/592328 to your computer and use it in GitHub Desktop.
#
# Create a new repo on Github and directly push your initial commit with this shell script
#
url=https://github.com/api/v2/json/repos/create
username=$(git config github.user)
token=$(git config github.token)
name=${1-$(basename $(pwd))}
curl -F login=$username -F token=$token $url -F name=$name -F public=1 1>/dev/null
git remote add origin git@github.com:$username/$name
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment