I have a directory containing a git repo as well as other unrelated files which I do not want tracked (its my home directory, sorry if this is bad practice--alternative recommendations for versioning bash profile and vim files are welcome!)
I can easily remove the .git directory, but that leaves me with all the tracked files in my directory. How do I delete all tracked files so I can completely remove the git repo and its relevant files, effectively "uncloning" or "uninstalling"?
In addition, after removing these files, how do I remove any directories that used to contain tracked files but are now empty?
Related (opposite question): Git: How to delete all untracked files
git ls-files -z | xargs -0 rm -fleads torm: cannot remove 'submodule/xxx': Is a directory. How tols-filesw/o directories? – pmor May 17 '22 at 12:21