Skip to content

Instantly share code, notes, and snippets.

@ZeroDeth
Created June 22, 2017 17:55
Show Gist options
  • Save ZeroDeth/abb0fdf895d1786d145d046d475f2bd0 to your computer and use it in GitHub Desktop.
Save ZeroDeth/abb0fdf895d1786d145d046d475f2bd0 to your computer and use it in GitHub Desktop.
Create a new repo at Github using git bash?
#!/bin/sh
# Create a new repo at Github using git bash?
reponame="$1"
if [ "$reponame" = "" ]; then
read -p "Enter Github Repository Name: " reponame
fi
mkdir ./$reponame
cd $reponame
# Add a Repository to GitHub using Git Command-line Calls Only?
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 [email protected]: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