I added a 150MB video to my projects source files and, unawarely, committed it. I then tried to git push
the commit to my remote repo and noticed the the push hung for a while and then eventually failed, spitting out this:
Counting objects: 17, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (17/17), 145.48 MiB | 138.00 KiB/s, done.
Total 17 (delta 13), reused 0 (delta 0)
remote: Resolving deltas: 100% (13/13), completed with 12 local objects.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 8b4191f1a1055e7dea4412f80b5125d2
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File src/images/greystone_place.mp4 is 145.45 MB; this exceeds GitHub's file size limit of 100.00 MB
I tried adding the file to .gitignore
but it was too late. Subsequent git push
commands yielded the same result.
Next, I tried to reset HEAD --soft to the commit where I originally committed the large file (this was after a few more commits involving .gitignore
). From there, I reset the file in question using git reset HEAD -- path/to/filename
to the working directory and committed again. Doing this, I still ran into the same error.
I later realized that maybe using the --amend
command would do the trick (based on this article), but this also didn't work.
I also tried using git rm --cached path/to/file
while I was in a soft reset. This also failed.
I have begun reading about git rebase i
and git filter-branch
but they seem complicated and I'm not sure if I'm barking up the wrong tree with this approach.
I am not a Git expert but in a nutshell, I want to do a git push
with my other changes and exclude this large file. Somehow, it seems to be intertwined in an earlier commit and is preventing me from making a push
to my remote repo.