Yesterday I spent several hours debugging a problem with my git repo that wasn't fixed by git reset HEAD --hard
because the files causing the problem were ignored by .gitignore
. Is there a way to "flush" or "clean" a git repo of all files that are being ignored, so that only the files tracked by git are present?
I finally fixed my problem by deleting the repo and cloning it from github again, but in the future, I would like to immediately remove all potentially problematic files (those that are being ignored).