2015-04-22 91 views

回答

1

使用git log-p参数会做你想要什么想

git log -p app/styles/ 

它会显示在app/styles文件夹改变所有文件的日志。 -p命令告诉它显示每次提交中引入的更改。输出看起来像:

commit 3101fd9a2862de007f6b47b58adab2d1e29a722b 
Author: David Zych <email> 
Date: Wed Apr 22 10:03:06 2015 -0700 

    (Some commit message) 

diff --git a/app/styles/site.css b/app/styles/site.css 
index a2b5d32..3df6ed1 100644 
--- a/app/styles/site.css 
+++ b/app/styles/site.css 
@@ -142,6 +142,11 @@ html { 
+ color: red; 
+ margin: 0; 
} 

如果要笔者限制自己,你可以添加--author标志。

git log -p --author "David Zych" app/styles/ 

如果要限制它最近的X更改,请使用-X标志,其中X是你想看到的变化的数量。要查看最近的更改:

git log -p -1 app/styles/ 
+3

您可能还想使用'--author'标志。 – Chris

相关问题