这个文档, 我们要解决每次add, commit, push的时候, 我们究竟提交了啥的问题.

目标

  1. 每次commit提交之前, 查看git的修改有哪些.
  2. 每次add之前, 查看git的修改有哪些.
  3. 每次push之前, 查看git的修改有哪些.

竟然都是diff

  1. 目前暂存中的修改:git diff –staged
  2. 尚未缓存的改动:git diff 缩写: gd
  3. 查看已缓存的改动: git diff —cached 缩写: gdca
  4. 查看已缓存的与未缓存的所有改动:git diff HEAD
  5. 显示摘要而非整个 diff:git diff –stat
  6. gdt git diff-tree –no-commit-id –name-only -r
  7. gdw git diff –word-diff

[http://m.runoob.com/git/git-basic-operations.html]