// 這條命令是查看含有 "224" 關鍵字的 git commit
git log --grep=224
// 查找 關於 cxm 提交的修改
git log --author=cxm
-
使用 git log --help 查看其它的應用
git log 查看提交記錄
git log 查看提交歷史記錄
git log --oneline 或者 git log --pretty=oneline 以精簡模式顯示
git log --graph 以圖形模式顯示
git log --stat 顯示文件更改列表
git log --author= 'name' 顯示某個作者的日志
git log -p filepath 查看某個文件的詳細修改
git log -L start,end:filepath 查看某個文件某幾行范圍內的修改記錄
git log --stat commitId 或者 git show --stat commitId 查看某一次提交的文件修改列表
git diff 文件對比
git diff filepath 工作區與暫存區比較
git diff HEAD filepath 工作區與HEAD ( 當前工作分支) 比較
git diff --staged 或 --cached filepath 暫存區與HEAD比較
git diff branchName filepath 當前分支的文件與branchName 分支的文件進行比較
git diff commitId filepath 與某一次提交進行比較