How do you check if a file or folder (in my case) has been deleted from your git history?

159 Views Asked by At

I used the "BFG Repo Cleaner" to remove a folder (target) I accidentally tracked and pushed to the remote repository, and I am wondering how I can I check if the folder was indeed completely removed from the git history?

1

There are 1 best solutions below

4
On

Say

 git log -- <pathnameOfFolder>

If it comes up empty, no commit containing such a folder is reachable.

If you know the name of just one file that used to be in this folder, and if that name is unique across the whole project, it suffices to say

 git log -n 1 -- */<filename>

If that comes up empty, that file is gone from the history; that will be a major clue that this has worked.