git commit修改 :
git commit --amend
git add之后取消add:
git rm --cached -r 目录 或git rm -f --cached logs/xx.log
git reset HEAD 文件名
git 撤销文件的修改
git checkout -- 文件名
忽略子目录 **/x 忽略子目录的x目录
!x.a 除x.a 除外忽略
/x 忽略项目根目录下的 x 文件,不包括 子目录/TODO
build/ 忽略build/ 目录下的所有文件
db/*.txt忽略db目录下txt文件