Context: I'm trying to remove some files from git because I was saving the checkpoints of my machine learning model on it, but as I do hyper parameter optimization with optuna and save the checkpoints for every trial by creating a separate directory inside the directory checkpoints for each one (this is something I may change on the code because there are too much files and I only need the best trial) it exceeded git limit when pushing. The first occurrence of the checkpoints folder is 14 commits ago and I already pushed before, but now it's exceeding gits size limit
Problem: I can't remove the files from the repository. I tried the following:
-
git reset --hard @~14 git rm -r --cached path/to/checkpoints git commit --ammend git reset --hard last_commit
-
git reset --hard @~14 git rm -rf --cached --ignore-unmatch path/to/checkpoints git commit --ammend git reset --hard last_commit
-
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch path/to/checkpoints" HEAD
Result: When I do git reset --hard @~14
the checkpoints folder is still there and when I do git push --force origin master
it doesn't work and I think it's still the size limit as I couldn't remove the files but now the connection fails (I already tried changing gits post buffer to see whether it solves the connection problem)