How to show git log history for a sub directory of a git repo?


Lets say that I have a git repo that looks like this.

   ... big tree here
   ... big tree here

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?


git log -- A
git log -- A/*
git log --oneline -- A
gitk -- foo/A
git log -p 8a5fb..HEAD -- .

For tracking changes to a folder where the folder was moved, I started using:

git rev-list --all --pretty=oneline -- "*/foo/subfoo/*"

This isn't perfect as it will grab other folders with the same name, but if it is unique, then it seems to work.

git-rev-list - 按反向时间顺序列出提交对象