git log 常用選項


git log 常用選項

-p 按補丁格式顯示每個更新之間的差異

jiqing@Ubuntu:/home/wwwroot/default/5hao/sheep$ git log -p
commit ba6e651f722d1c4e3612ab38b132377711edc709
Author: jiqing <jiqing@caomall.net>
Date:   Wed Apr 25 16:59:28 2018 +0800

    轉贈五號豆收尾

diff --git a/Wx/Tpl/Mine/bean_transfer_step_two.html b/Wx/Tpl/Mine/bean_transfer_step_two.html
Date:   Wed Apr 25 16:59:28 2018 +0800

    轉贈五號豆收尾

diff --git a/Wx/Tpl/Mine/bean_transfer_step_two.html b/Wx/Tpl/Mine/bean_transfer
_step_two.html
index 2e56015..204a525 100644
--- a/Wx/Tpl/Mine/bean_transfer_step_two.html
+++ b/Wx/Tpl/Mine/bean_transfer_step_two.html
@@ -1,7 +1,6 @@
 <include file="Public:header" />
 <div class="content">
         <div class="user-info" id="for_data_ejs">
-
         </div>
         <div class="box-form">
             <input type="number" class="bean_transfer_num" placeholder="請輸入
轉贈五號豆數量" id="bean_transfer_num" onkeyup="value=value.replace(/[^\d]/g,'')" value="" />

--stat 顯示每次更新的文件修改統計信息

jiqing@Ubuntu:/home/wwwroot/default/5hao/sheep$ git log --stat
commit ba6e651f722d1c4e3612ab38b132377711edc709
Author: jiqing <jiqing@caomall.net>
Date:   Wed Apr 25 16:59:28 2018 +0800

    轉贈五號豆收尾

 Wx/Tpl/Mine/bean_transfer_step_two.html | 1 -
 1 file changed, 1 deletion(-)

--shortstat 只顯示 --stat 中最后的行數修改添加移除統計。

jiqing@Ubuntu:/home/wwwroot/default/5hao/sheep$ git log --shortstat
commit ba6e651f722d1c4e3612ab38b132377711edc709
Author: jiqing <jiqing@caomall.net>
Date:   Wed Apr 25 16:59:28 2018 +0800

    轉贈五號豆收尾

 1 file changed, 1 deletion(-)

--name-only 僅在提交信息后顯示已修改的文件清單。

jiqing@Ubuntu:/home/wwwroot/default/5hao/sheep$ git log --name-only
commit ba6e651f722d1c4e3612ab38b132377711edc709
Author: jiqing <jiqing@caomall.net>
Date:   Wed Apr 25 16:59:28 2018 +0800

    轉贈五號豆收尾

Wx/Tpl/Mine/bean_transfer_step_two.html

--name-status 顯示新增、修改、刪除的文件清單。

jiqing@Ubuntu:/home/wwwroot/default/5hao/sheep$ git log --name-status
commit ba6e651f722d1c4e3612ab38b132377711edc709
Author: jiqing <jiqing@caomall.net>
Date:   Wed Apr 25 16:59:28 2018 +0800

    轉贈五號豆收尾

M       Wx/Tpl/Mine/bean_transfer_step_two.html

--abbrev-commit 僅顯示 SHA-1 的前幾個字符,而非所有的 40 個字符。

jiqing@Ubuntu:/home/wwwroot/default/5hao/sheep$ git log --abbrev-commit
commit ba6e651
Author: jiqing <jiqing@caomall.net>
Date:   Wed Apr 25 16:59:28 2018 +0800

    轉贈五號豆收尾

--author jiqing 指定作者

jiqing@Ubuntu:/home/wwwroot/default/5hao/sheep$ git log --author jiqing
commit ba6e651f722d1c4e3612ab38b132377711edc709
Author: jiqing <jiqing@caomall.net>
Date:   Wed Apr 25 16:59:28 2018 +0800

    轉贈五號豆收尾

commit c1b7ec7ea1f0cf076197c9b105f2e968f5b4d1c8
Merge: 28c658d 0063f8d
Author: jiqing <jiqing@caomall.net>
Date:   Wed Apr 25 16:59:11 2018 +0800

    Merge branch '5hao' of https://git.coding.net/sucry-integral/sheep into 5hao


--pretty 美化

jiqing@Ubuntu:/home/wwwroot/default/5hao/sheep$ git log --pretty=short
commit ba6e651f722d1c4e3612ab38b132377711edc709
Author: jiqing <jiqing@caomall.net>

    轉贈五號豆收尾

commit c1b7ec7ea1f0cf076197c9b105f2e968f5b4d1c8
Merge: 28c658d 0063f8d
Author: jiqing <jiqing@caomall.net>

    Merge branch '5hao' of https://git.coding.net/sucry-integral/sheep into 5hao


也可以組合使用

jiqing@Ubuntu:/home/wwwroot/default/5hao/sheep$ git log --pretty=short --author=jiqing
commit ba6e651f722d1c4e3612ab38b132377711edc709
Author: jiqing <jiqing@caomall.net>

    轉贈五號豆收尾

commit c1b7ec7ea1f0cf076197c9b105f2e968f5b4d1c8
Merge: 28c658d 0063f8d
Author: jiqing <jiqing@caomall.net>

    Merge branch '5hao' of https://git.coding.net/sucry-integral/sheep into 5hao

commit 28c658de7b324772c385be232abf48b4b8410cef
Author: jiqing <jiqing@caomall.net>

    轉贈五號豆收尾

commit 0e125b52d1178869274de81943fd16f67d574d06
Author: jiqing <jiqing@caomall.net>

    轉贈五號豆初步

commit 5f80991fe38b1cb44079441eb90e8b629d89d19f
Author: jiqing <jiqing@caomall.net>

    驗證第一步


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM