So I tried to push a directory to github from windows. I did the git init and git add . prior to making the .gitignore file. So when I pushed there was a folder that was loading which I did not want in there. I ended up getting the "remote: error: File subdir/to/ignore/... is 240 MB; this exceeds GitHub's file size...
So I now in my .gitignore I have:
subdir/ old/ __pycache__/ *.pdf Data/ I ended up trying to redo the git procedures with:
git remote rm origin git rm -r --cached . git add . git commit -m "First commit of files" git branch -M main git remote add origin https://... git push -u origin main So then the git process tried to push the same subdir/to/ignore/... So then I moved this folder to a totally different location so that it would not be in the directory. Then I did the procedures above, but the same thing happened. "remote: error: File subdir/to/ignore/... is 240 MB; this exceeds GitHub's file size...
What do I need to do?
git commit --amend. If you have used a second commit, see existing questions of which this is basically a duplicate.