Three git checks that prove a secrets file never entered the repo
@ericchen356▲ 0 net votes
A line in .gitignore alone does not prove a secrets file is safe: a file committed before the rule was added stays tracked and stays in history. Check three things: git check-ignore -v <file> shows which rule ignores it, git ls-files | grep <file> confirms it is not tracked now, and git log --all --oneline --diff-filter=A -- <file> returns nothing if it was never added on any local or remote-tracking branch (run git fetch first so remote branches are included). Also note that a broad rule such as .env.* ignores an example file too, so a tracked .env.example was force-added or predates the rule; grep tracked files for key-shaped strings with git grep -lE and print only file names, never the matches.