I had some unexpectedly large files which I committed and pushed. The git push failed because they were too large.
So I removed them from my local repo directory and then I made a new git add/commit/push
and git was still trying to push the same large files so it failed again.
I did a git status
and noticed the files were still in the "Changes not staged for commit"
lower part of the status report and colored in red. I also noticed they have instructions saying I should "add/remove files to update what will be committed"
, so I ran a "git rm filename"
on the files. As a result of that, I did a new git status and saw the same files in the upper area of the git status report, now in green.
So thinking I had succeeded, I did a new git add/commit/push
and this failed again for the same reason: the same files were trying to be pushed and were too large.
So I read up more and tried doing a git rm --cache filename
on all the files, but this command failed saying the file did not exist.
Now if I do a git status I no longer see the files I deleted, but if I push it still tries to push the. Could anybody please recommend how to troubleshoot this? I really can't lose my local work.
By the way, I can overwrite the remote with no problem as I am the only one working on it.