GIT log 日誌查詢

2021-09-24 07:21:01 字數 609 閱讀 8608

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 filepath 工作區與暫存區比較

git diff head filepath 工作區與head ( 當前工作分支) 比較

git diff --staged 或 --cached filepath 暫存區與head比較

git diff branchname filepath 當前分支的檔案與branchname 分支的檔案進行比較

git diff commitid filepath 與某一次提交進行比較

git log格式化日誌

git log pretty format arg h 提交物件 commit 的完整雜湊字串 h 提交物件的簡短雜湊字串 t 樹物件 tree 的完整雜湊字串 t 樹物件的簡短雜湊字串 p 父物件 parent 的完整雜湊字串 p 父物件的簡短雜湊字串 an 作者 author 的名字 ae 作者...

Git log 高階用法

你可以看到專案的歷史記錄 誰貢獻了什麼 bug 是什麼時候引入的,還可以撤回有問題的更改.git log 有兩個高階用法 一是自定義提交的輸出格式,二是過濾輸出哪些提交.只顯示提交id和提交資訊的第一行 git log oneline 知道每個提交關聯的分支或者標籤 git log oneline ...

實用的git log用法

git log可以很方便地檢視日誌,可以根據自己需要,將日誌按照特定格式顯示,或者輸出某種格式。最原始的輸出樣式 git log commit ca82a6dff817ec66f44342007202690a93763949 author scott chacon date mon mar 17 2...