I have a few files in my git status -s listed as,
?? file1
?? filepath/file2
?? file3
?? filepath/file4
I have been ignoring these and going along committing, pushing, pulling, and I am at the point where there are too many of these in my status report.
I tried git rm file1. It doesn’t work. It says fatal path doesn’t match any files.
Thanks!
These are untracked files, i.e. the files which are present in your file system, but you’ve never added them to your repository by
git add.If you don’t need them, you can just
rmthem. Or simplygit clean -fdif you want to delete them all. If you want to do some filtering before removing them, you can do:If you want to keep those files, but want
git statusto ignore them, add them to.gitignorefile. Readman gitignorefor the details.