Turn the current directory into a new GitHub repository
Open:
/home/YOUR USERNAME/.bashrc
then append:
github-create () {
currentDir=${PWD##*/}
currentDir=${currentDir// /_}
userName=$1
curl -u $userName https://api.github.com/user/repos -d '{"name":"'$currentDir'"}' &&
echo "# "$currentDir >> README.md &&
git init &&
git add -A . &&
git commit -m "first commit" &&
git remote add origin https://github.com/$userName/$currentDir.git &&
git push -u origin master
}
then, in a terminal:
source ~/.bashrc
In a terminal, go to the directory you want to turn into a GitHub repo and type this:
github-create <YOUR GITHUB USERNAME>