Skip to content

Instantly share code, notes, and snippets.

@mrshll
Last active December 10, 2015 07:38
Show Gist options
  • Save mrshll/4402811 to your computer and use it in GitHub Desktop.
Save mrshll/4402811 to your computer and use it in GitHub Desktop.
alias to create and initialize a new git repository from shell
USER=$(git config --get github.user)
# takes in new repo's name as argument
# ex// $ git-create tufts-hackathon
function git-create () {
git init
touch README.md
curl -u "${USER}" https://api.github.com/user/repos -d '{"name":"'${1}'"}' > /dev/null
git remote add origin [email protected]:${USER}/${1}.git
git add .
git commit -am 'first commit'
git push -u origin master
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment