-1

I added a large file to my git repo and committed it to my local branch, but when I try to push it I get an error because it is too big for GitHub. I would like to remove this commit, because all commits behind this one are failing because this one fails.

Here is the error I am getting:

remote: Resolving deltas: 100% (7/7), completed with 4 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: 59534b1053878c7acadb3629a9c4883d
remote: error: See http://git.io/iEPt8g for more information.

I tried a git rm, but of course, that commit can't be pushed either.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
bijouvj
  • 49
  • 1
  • 3
  • 1
    Try resetting to before you added the file? – evolutionxbox Jul 11 '19 at 23:51
  • Possible duplicate of [How to remove a too large file in a commit when my branch is ahead of master by 5 commits](https://stackoverflow.com/questions/20002557/how-to-remove-a-too-large-file-in-a-commit-when-my-branch-is-ahead-of-master-by) – Gino Mempin Jul 12 '19 at 00:09
  • Possible duplicate of [How to remove/delete a large file from commit history in Git repository?](https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository) – phd Jul 12 '19 at 00:35
  • https://stackoverflow.com/search?q=%5Bgit%5D+remove+large+file+history – phd Jul 12 '19 at 00:36

1 Answers1

0

Is this your last commit on the repository? If so you can run

git reset --soft HEAD~1

That will set your local repository as if you were just about to commit your changes again, there you can delete the file you are talking about and then commit again without that file being in your commit

Samuel Chavez
  • 768
  • 9
  • 12