I noticed a moment ago that my .gitconfig -file was public at my repo. It contains my secret tokens.
I git-add -u
the file and committed. I am not sure whether this command removes the file from the previous commits too.
I want to be sure and search the file in my previous commits such that there is no such a file in my history.
How can you search the file in previous commits?
I run
git filter-branch --tree-filter 'rm .gitconfig' master # Thanks to Greg!
I get
Rewrite 84dabfa2ea195ce9aad0309216858b302150017c (1/25)rm: .gitconfig: No such file or directory
tree filter failed: rm .gitconfig
The error message suggests me that I do not have the file at my commit history.
Is there any way to search the file in my commit history such that I do not need to run the removal to see that I do not have the file in my commit history?