Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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' -d \{\"name\":\"$1\"\}
# Uncomment the line below to use HTTPS (will prompt for password)
# git remote add origin$1.git
# Uncomment the line below to use SSH (requires prior setup)
# git remote add origin$1.git
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment