Skip to content

Instantly share code, notes, and snippets.

@Krishna829
Created October 14, 2019 14:57
Show Gist options
  • Save Krishna829/9d09f43f8b97e567222933e7efb91cc8 to your computer and use it in GitHub Desktop.
Save Krishna829/9d09f43f8b97e567222933e7efb91cc8 to your computer and use it in GitHub Desktop.
create github repo
#!/bin/sh
reponame="$1"
if [ "$reponame" = "" ]; then
read -p "Enter Github Repository Name: " reponame
fi
mkdir ./$reponame
cd $reponame
curl -u USERNAME https://api.github.com/user/repos -d "{\"name\":\"$reponame\"}"
git init
echo "ADD README CONTENT" > README.md
git add README.md
git commit -m "Starting Out"
git remote add origin git@github.com:USERNAME/$reponame.git
git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment