-
-
Save cyberbikepunk/0674f249e708b998f809 to your computer and use it in GitHub Desktop.
Create a repo on Github from the command line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function repo() { | |
if [ $# -eq 2 ]; then | |
# name of repo to be created | |
PROJECTNAME="$1" | |
DESCRIPTION="$2" | |
POST="{\"name\":\"$PROJECTNAME\",\"description\":\"$DESCRIPTION\"}" | |
curl –sS -u 'cyberbikepunk' https://api.github.com/user/repos -d "$POST" | |
git remote add origin git@github.com:cyberbikepunk/$PROJECTNAME.git | |
echo "remote origin added" | |
else | |
echo "Wrong number of Arguments. \$1 = Name and \$2 = Description" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment