Skip to content

Instantly share code, notes, and snippets.

@syui
Created July 31, 2014 05:58
Show Gist options
  • Save syui/bc28c26c6bf7d7bac9d2 to your computer and use it in GitHub Desktop.
Save syui/bc28c26c6bf7d7bac9d2 to your computer and use it in GitHub Desktop.
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