git status 查看变更git status -s 查看变更简单模式git status --ignored 展示忽略的文件git log 查看日志git log --oneline 单行查看日志git log --stat 显示详细commit历史git reflog 显示当前分支的最近几次提交git log <-number> [--pretty] [--oneline] 显示过去几次提交git log --follow [file] 显示文件版本历史git blame [file] 显示指定文件是什么人在什么时间修改过git show [--name-only] <commit-id> 显示commit内容变化git show [commit-id]:[file] 显示某次提交时,某个文件的内容git log --grep <keyword> 过滤&搜索git log --author <author-name> 指定作者查询git log --after='<date>' --until='<date>' 通过日期查找
git log --oneline --after="2019-02-20" --until='2020-02-20'
git grep <keyword> [branch-name|tag-name] 搜索
git grep "Hello"
git grep "Hello" v2.5
git diff 显示暂存区和工作区的差异git log -p [file] 显示指定文件相关的每一次diffgit diff --cached [file] 显示暂存区和上一个commit的差异git diff [first-branch] [second-branch] 显示两次提交之间的差异git diff HEAD 显示工作区与当前分支最新commit之间的差异git shortlog -sn 显示所有提交过的用户,按提交次数排序git diff --shortstat "@{0 day ago}" 显示今天你写了多少行代码git log --graph --decorate --oneline 绘制分支图