ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

git 查看提交记录

2021-05-30 21:54:16  阅读:156  来源: 互联网

标签:pull git 查看 format -- Merge master 提交


git 查看提交记录

查看提交的内容

-p 选项,同时在 - 后加数字限制一下数目

git log -p -2. 

commit 500eeadd71a21f1166803e12a792bfa86f4ca784 (HEAD -> master, origin/master, origin/HEAD)
Merge: 1cb2e13 13289e4
Author: Łukasz Mróz <lukasz.mroz@droidsonroids.pl>
Date:   Wed May 24 12:15:11 2017 +0200

    Merge pull request #9 from user3587412/master

    Update example to newer reducer format

commit 13289e4ead28e24320dd85e157242b45a6b720ce
Author: Edel Sah <edelsah@me.com>
Date:   Tue May 2 03:44:05 2017 -0500

    Update to newer reducer format

diff --git a/Cartfile b/Cartfile
index 16a99cf..f43b92e 100644
--- a/Cartfile
+++ b/Cartfile

查看提交的统计情况。

git log --stat. 

commit 13289e4ead28e24320dd85e157242b45a6b720ce
Author: Edel Sah <edelsah@me.com>
Date:   Tue May 2 03:44:05 2017 -0500

    Update to newer reducer format

 Cartfile                                     |  2 +-
 Cartfile.resolved                            |  2 +-
 CounterExample/AppDelegate.swift             |  2 +-
 CounterExample/Reducers/CounterReducer.swift | 29 +++++++++++------------------
 4 files changed, 14 insertions(+), 21 deletions(-)

commit 1cb2e1328208c30dd1d28bfc5e4934a9205d1ded
Merge: 7fc44d4 fcb781b
Author: Colin Eberhardt <colin.eberhardt@gmail.com>
Date:   Thu Nov 10 06:03:12 2016 +0000

    Merge pull request #6 from juegas/master

    Update Example for Xcode 8.1 Swift 3.0.1

每次提交,只有一行

git log --pretty=oneline

500eeadd71a21f1166803e12a792bfa86f4ca784 (HEAD -> master, origin/master, origin/HEAD) Merge pull request #9 from user3587412/master
13289e4ead28e24320dd85e157242b45a6b720ce Update to newer reducer format
1cb2e1328208c30dd1d28bfc5e4934a9205d1ded Merge pull request #6 from juegas/master
fcb781bc8fc89dac367188d79a87b490b0a2a2e3 add gif

格式化提交记录。

git log --pretty=format:"%h - %an, %ar : %s"

500eead - Łukasz Mróz, 1 year, 1 month ago : Merge pull request #9 from user3587412/master
13289e4 - Edel Sah, 1 year, 1 month ago : Update to newer reducer format
1cb2e13 - Colin Eberhardt, 1 year, 7 months ago : Merge pull request #6 from juegas/master
fcb781b - Cristiam, 1 year, 7 months ago : add gif
d3637e4 - Cristiam, 1 year, 7 months ago : update
dce6b0b - Cristiam, 1 year, 7 months ago : Xcode 8.1 Swift 3.0.1

图形化展示。

--format.

git log --pretty=format:"%h %s" --graph

*   500eead Merge pull request #9 from user3587412/master
|\
| * 13289e4 Update to newer reducer format
|/
*   1cb2e13 Merge pull request #6 from juegas/master
|\
| * fcb781b add gif
| * d3637e4 update
| * dce6b0b Xcode 8.1 Swift 3.0.1
|/
*   7fc44d4 Merge pull request #1 from kuchmiyalex/master
|\
| * 73890f5 Fixed local paths, removed unused.
|/

过滤作者.

git log  --author Cristiam --pretty=format:"%an %s"

Cristiam add gif
Cristiam update
Cristiam Xcode 8.1 Swift 3.0.1

过滤提交历史的关键字

git log --grep Xcode

commit 1cb2e1328208c30dd1d28bfc5e4934a9205d1ded
Merge: 7fc44d4 fcb781b
Author: Colin Eberhardt <colin.eberhardt@gmail.com>
Date:   Thu Nov 10 06:03:12 2016 +0000

    Merge pull request #6 from juegas/master

    Update Example for Xcode 8.1 Swift 3.0.1

commit dce6b0be6b53775f8cf45a23c8ba7d8c4be97f98
Author: Cristiam <cristiamreinoso@Cristiams-MBP.home>
Date:   Tue Nov 8 21:19:26 2016 -0500

    Xcode 8.1 Swift 3.0.1

    update example

找到改变关键字的提交

git log -S AppState -p

commit 13289e4ead28e24320dd85e157242b45a6b720ce
Author: Edel Sah <edelsah@me.com>
Date:   Tue May 2 03:44:05 2017 -0500

    Update to newer reducer format

diff --git a/CounterExample/Reducers/CounterReducer.swift b/CounterExample/Reducers/CounterReducer.swift
index 966c88d..b46ea37 100644
--- a/CounterExample/Reducers/CounterReducer.swift
+++ b/CounterExample/Reducers/CounterReducer.swift
@@ -2,25 +2,18 @@ import ReSwift

 // the reducer is responsible for evolving the application state based
 // on the actions it receives
-struct CounterReducer: Reducer {
-    typealias ReducerStateType = AppState
-
+func counterReducer(action: Action, state: AppState?) -> AppState {
+    // if no state has been provided, create the default state
+    var state = state ?? AppState()

posted on 2018-06-10 13:04  花老????  阅读(306)  评论(0)  编辑  收藏

标签:pull,git,查看,format,--,Merge,master,提交
来源: https://blog.51cto.com/u_15223551/2834025

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有