I want to put a legacy code of mine on GitHub. In a foolish move, I selected the whole project (in PyCharm) to add to the initial commit; I forgot that this includes data and plot directories that are huge and exceed any file and repo size limit (8+ GB). I had hoped I could just remove the unnecessary files and directories later on, but:
The initial push to GitHub fails, and I seem to not be able to use git revert
, git reset
and other methods I found here, since there is no previous commit to go back to.
I don't want to risk my code, so I turn to you: how to I either
- remove the offending directories and the files therein from the commit but not from my disk, or
- ditch this (local) repository and make a new one to connect to GitHub, where I do not include these directories from the get-go?
I looked through many, many answers here, and I just don't seem to find one. Is it that obvious? Thank you all for your help! :)