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

Question

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

foo/
  .git/
  A/
   ... big tree here
  B/
   ... 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?

Answer

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 - 按反向时间顺序列出提交对象

  • qq_43638135
    妲己再美究为妃: 博主没有想过自己接一些私活干吗?我现在还没毕业,但是我也确实听说外挂市场自动化游戏脚本市场挺火热的,并且报酬也很丰厚,但是具体的我也不是很清楚,求解答。 (1个月前 #47楼) 查看回复(2) 举报 回复
    22