Using git to see all logs related to a specific file extension within subdirectories

Try:

git log --oneline -- '*.txt'

The -- is used to indicate only positional arguments will follow. And '*.txt' searches all folders from the current directory on down.

Alternatively, you could limit the results by starting the search in a subdirectory, e.g. -- 'sub/*.txt'.

Leave a Comment