Undo last commit:
git reset --soft HEAD~1
Download just the source code of a project:
curl -sL https://github.com/feihong/tutorial-boilerplate/archive/master.tar.gz | tar xz
Create new, empty repo, sync it to GitHub, and create the gh-pages branch:
USERNAME=feihong
REPONAME=repo-name
REPODESCRIPTION="repo description"
curl -u $USERNAME https://api.github.com/user/repos -d "{\"name\": \"$REPONAME\", \"description\": \"${REPODESCRIPTION}\"}"
git init
git remote add origin [email protected]:$USERNAME/$REPONAME.git
git remote -v
echo "$REPONAME" >> README.md
git add README.md
git commit -m "Initial commit"
git push -u origin master
cd /tmp
git clone [email protected]:$USERNAME/$REPONAME.git
cd $REPONAME
git checkout --orphan gh-pages
git rm -rf .
echo "Hello GitHub Pages!" > index.html
touch .nojekyll
git add .
git commit -a -m "Initial pages commit"
git push origin gh-pages
Sources: