Create a GitHub repo from the command line
Add this to your ~/.bashrc:
gitinit() {
git init
git add .
git commit -am "init"
git remote add origin git@github.com:$1/$2.git
curl -u 'USER' https://api.github.com/orgs/$1/repos -d "{\"name\":\"$2\"}"
git push -u origin master
}
alias gitinit=gitinit
Written by Lance Pollard
Related protips
2 Responses
If you're unfamiliar you might find "hub" from GitHub useful. It lets you do this and much more: https://github.com/github/hub
over 1 year ago
·
+1 hub
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#