Created
July 31, 2014 05:58
-
-
Save syui/bc28c26c6bf7d7bac9d2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function gitinit(){ | |
echo -n username: | |
read user | |
repo=`echo $PWD:t` | |
repo_j={\"name\":\"$repo\"} | |
url="https://github.com/"$user/$repo.git | |
curl -u $user https://api.github.com/user/repos -d $repo_j | |
case $? in | |
0) | |
rm -rf .git | |
git init | |
echo $url | |
git remote add origin $url | |
git commit --allow-empty -m "noun" | |
git push -u origin master | |
;; | |
esac | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment