I have never encountered this problem before and have no idea how this is possible. I had a really large directory that I downloaded by mistake into my git repo. I inadvertently did a git add .
so the large directory got added to the working tree and when I tried to commit, it didn't allow me to, as the file was too big.
Then I didn't do a git rm
and directly removed the file from the filesystem. The next time I tried to commit, it didn't allow me to and is still complaining that the directory (which is now no longer present on the filesystem) is too big.
Doesn't removing a file from the filesystem also remove it from the git working tree?
If there is a way to undo my last 2 commits without losing changes,and then re-push it to remote, that would be great.