Last active
December 10, 2015 07:38
-
-
Save mrshll/4402811 to your computer and use it in GitHub Desktop.
alias to create and initialize a new git repository from shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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