The situation is as follows: we have a file A.out
in our git repository that grew over time and now became too large to be pushed to github. I only realized the latter several commits after it became too large, so here is how the repo looks like:
- COMMIT5 (HEAD) contains
A.out
exceeding 100mb - COMMIT4 does not contain
A.out
- COMMIT3 does contain
A.out
exceeding 100mb - COMMIT2 (origin/HEAD) does not contain
A.out
- COMMIT1 does contain
A.out
not exceeding 100mb
COMMIT2 is the last commit that I pushed to github, and I now cannot push after COMMIT5.
How can I remove
A.out
from commits 3 and 4, while keeping it in its newest >100mb version locally (and untracked from git)?
EDIT: The question originates in a large file issue with github, this specific case can probably be handled as explained at How to import git repositories with large files? (pointed out by @phd). But the question as stated is, of course, independent of involved file sizes. In my specific case, the git version is too old to support git-lfs currently, but I don't want to wait until the server's version is updated.