For files you might want to change your command line slightly to the suggested command-line on the git-rm page git ls-files -z | xargs -0 rm -f.
git rm -r --cached . – Remove all tracked files, including wanted and unwanted. Your code will be safe as long as you have saved locally. git ...
How to remove local untracked files from the current Git branch · To remove directories, run git clean -f -d or git clean -fd · To remove ignored files, ...
Remove files matching pathspec from the index, or from the working tree and the ... Typically you would first remove all tracked files from the working tree using ...
Don't actually remove anything, just show what would be done. git clean -n. or · Remove untracked directories in addition to untracked files. If an ...
DESCRIPTION. Cleans the working tree by recursively removing files that are not under version control, starting from the current directory. Normally, only files ...
The -d option tells git to remove untracked directories too. If you don't want to delete empty untracked directories, omit -d option. The -f option ...
To remove a file from Git, you have to remove it from your tracked files (more accurately, remove it from your staging area) and then commit. The git rm command ...
More Git remove (don't track) examples. If it helps to see some more examples, here's a list of all the git rm --cached commands I ended up ...
Assuming you do want to remove cruft files or clean your working directory, you can do so with git clean . To remove all the untracked files in your working directory ...