Skip to content

Instantly share code, notes, and snippets.

@banunatina
Created March 3, 2016 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save banunatina/0a9ca3ef57282fd7b099 to your computer and use it in GitHub Desktop.
Save banunatina/0a9ca3ef57282fd7b099 to your computer and use it in GitHub Desktop.
ZSH Script to create a github repo using HTTPS/SSH, set it as the origin, and push to its master branch
# This zsh script takes 1 parameter - the repo name.
# Remember replace USER with your username!
makerepo () {
curl -u 'USER' https://api.github.com/user/repos -d \{\"name\":\"$1\"\}
# Uncomment the line below to use HTTPS (will prompt for password)
# git remote add origin https://github.com/USER/$1.git
# Uncomment the line below to use SSH (requires prior setup)
# git remote add origin git@github.com:USER/$1.git
git push origin master
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment