Skip to content

Instantly share code, notes, and snippets.

@ralekna
Forked from robwierzbowski/gitcreate.sh
Last active August 29, 2015 14:24
Show Gist options
  • Save ralekna/047c0f81aeace9ff91d1 to your computer and use it in GitHub Desktop.
Save ralekna/047c0f81aeace9ff91d1 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Form from https://gist.github.com/robwierzbowski/5430952/
# Create a remote repo on GitHub and clone it to your computer
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Get user input
echo "New repo name:"
read REPONAME
echo "Git Username:"
read USER
echo "Repo Description:"
read DESCRIPTION
echo "Here we go..."
# Curl some json to the github API oh damn we so fancy
curl -u ${USER} https://api.github.com/user/repos -d "{\"name\": \"$REPONAME\", \"description\": \"$DESCRIPTION\", \"auto_init\":true}"
# Cloning repo to local computer
git clone [email protected]:$USER/$REPONAME.git
# cleaning up
REPONAME=
USER=
DESCRIPTION=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment