Gerrit
Gerrit

Reputation: 1599

Searching in history of Git repro for specific files

How do I search in the history of my git repository for specific filetypes? (for example *.log)

I know I can search with ls-files in the current state or in a specific commit, but I want to search in all commits. This does include files that have been removed from the branch in earlier commits.

The end result should list all the filenames and the commits where the file was effected. With that list, I can go back to the earlier version of the file and review it.

Upvotes: 0

Views: 55

Answers (1)

EncryptedWatermelon
EncryptedWatermelon

Reputation: 5598

To show all *.log files in whole history. You may want to write the output to a file or pipe into less. You can also add --pretty=short to reduce output

git log --all --name-only -- *.log

Upvotes: 3

Related Questions