For me, the problem was that I had a filename in my .gitignore file which did not exist. Removing this invalid filename from .gitignore solved the problem. Also, I deleted all the .gitignore files from subdirectories and only kept the top-level .gitignore file.