git 查看提交历史

时间:2023-03-08 16:24:08

查看提交历史

git log

查看每次提交的具体改动内容

git log -p

查看某个文件历次提交的具体改动内容

git log -p <file name>

# git log -p test.py

查看某次提交具体改动的内容

git log -p

git log -p d9c575c440d220756e60a6c9de38

commit d9c575c440d220756e60a6c9de38 (HEAD -> master, origin/master)
Author: lanyang
Date: Fri Oct 19 15:09:28 2018 +0800 [Change] 去掉调试log diff --git a/app/views/view.py b/app/views/view.py
index 232b5e9..11e3f03 100644
--- a/app/views/view.py
+++ b/app/views/view.py
@@ -120,7 +120,6 @@ class LineApi: def save_info(self, objects):
for job in objects:
- print job
app_name = job['app_name'] @@ -196,8 +195,6 @@ class LineApi:
# save info
self.save_info(data_list) -
-
def save_info(self, p_list): for info in p_list:

查看提交改动了哪些文件

git log --stat

commit d9c575c440d220756e60d1a6c9de38 (HEAD -> master, origin/master)
Author: langyang
Date: Fri Oct 19 15:09:28 2018 +0800 [Change] 去掉调试log app/views/view.py | 3 ---
1 file changed, 3 deletions(-) commit a20959291bf8bf07ef4c8ce170181ea85e4
Author: langyang
Date: Fri Oct 19 14:45:06 2018 +0800 [Feature] 新增数据同步功能 app/views/config.py | 10 +++----
app/views/view.py | 225 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------
config.py | 3 +-
3 files changed, 149 insertions(+), 89 deletions(-)

参考

https://git-scm.com/book/zh/v1/Git-基础-查看提交历史