如何显示git仓库的子目录的git日志历史记录(即所有相关的提交)? [英] How to show git log history (i.e., all the related commits) for a sub directory of a git repo?
本文介绍了如何显示git仓库的子目录的git日志历史记录(即所有相关的提交)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
让我们说我有一个看起来像这样的git repo.
Lets say that I have a git repo that looks like this.
foo/
.git/
A/
... big tree here
B/
... big tree here
有没有办法让git log只显示特定目录的日志消息.例如,我只想查看仅在foo/A中提交了触摸文件的内容?
Is there a way to ask git log to show only the log messages for a specific directory. For example I want to see what commits touched files in foo/A only?
推荐答案
从目录foo/
中使用
git log -- A
您需要使用-"将<path>..
与<since>..<until>
引用规范分开.
You need the '--' to separate <path>..
from the <since>..<until>
refspecs.
# Show changes for src/nvfs
$ git log --oneline -- src/nvfs
d6f6b3b Changes for Mac OS X
803fcc3 Initial Commit
# Show all changes (one additional commit besides in src/nvfs).
$ git log --oneline
d6f6b3b Changes for Mac OS X
96cbb79 gitignore
803fcc3 Initial Commit
这篇关于如何显示git仓库的子目录的git日志历史记录(即所有相关的提交)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文