I am trying to see commits in the repository history, but only for files with a specific extension.
If this is a directory structure:
$ tree . ├── a.txt ├── b └── subdir ├── c.txt └── d
And this is the full story:
$ git log --name-only --oneline a166980 4 subdir/d 1a1eec6 3 subdir/c.txt bc6a027 2 b f8d4414 1 a.txt
If I want to see the logs for a file with the extension .txt:
$ git log --oneline *.txt f8d4414 1
It returns only the file located in the current directory, and not in subdirectories. I want to include all possible subdirectories inside the current directory.
I also tried:
$ git log --oneline */*.txt 1a1eec6 3
and
$ git log --oneline *.txt */*.txt 1a1eec6 3 f8d4414 1
This works for this case, but it is not practical for more general cases.
and
$ git log --oneline HEAD -- *.txt f8d4414 1
Without success.
source share