$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
$ git init
$ pwd
$ git add 文件名
$ git commit -m "提交说明"
$ git status
$ git reflog
$ git diff
$ git log
按行输出
$ git log --pretty=oneline
回退到上一个版本
$ git reset --hard HEAD^
回退到上n个版本
$ git reset --hard HEAD~n
去到指定版本
$ git reset --hard 版本号
$ git checkout -- 文件名
$ rm 文件名
$ git branch 分支名
$ git checkout 分支名
创建某分支并转到该分支
$ git checkout -b 分支名
$ git branch
$ git merge 分支名
$ git branch -d 分支名
$ git stash
$ git stash list
恢复后仍保留 stash
$ git stash apply
恢复后删除 stash
$ git stash pop
恢复指定版本的 stash
$ git stash apply stash@{0}