0

Once I have add a file in a folder and tried to push it. But it is said that it exceed the size limit. Thus, I deleted it on my local disk. And later I tried to commit and push again(other changes) but got a same error: remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com. And then I tried git reset, git commit --amend but they all failed. And git rm file but it is not there anymore. This is so annoying. Could you help me with this? Thanks in advance!

southdoor
  • 431
  • 1
  • 8
  • 22
  • git rm should work on non-existent files if they are already in the cache. What's your git status? Also git reset --hard HEAD will force undo all your current changes (without --hard the changes will remain in the workarea). – kabanus Oct 31 '16 at 19:42
  • @kabanus `On branch master nothing to commit, working tree clean` – southdoor Oct 31 '16 at 19:45
  • It looks like stuff is already in your commit history, so you need to undo the previous commit. Do a `git show --name-only HEAD` and see if the large file is in there. – merlin2011 Oct 31 '16 at 19:49
  • @merlin2011 How? I tried this [solution](http://stackoverflow.com/questions/927358/how-to-undo-last-commits-in-git) but it doesn't work – southdoor Oct 31 '16 at 19:51
  • Are you sure the last commit contained the large file and not a commit earlier in the history? – merlin2011 Oct 31 '16 at 19:53
  • @merlin2011 solved. Thanks! – southdoor Oct 31 '16 at 19:55
  • You could tell us the solution... ;) – Riccardo Petraglia Nov 02 '16 at 08:05
  • 1
    @RiccardoPetraglia Just reset to the last commit recorded in github. And then make a new commit again. Quite easy actually... :) – southdoor Nov 02 '16 at 12:39

1 Answers1

0

This is a tool that delete all the large files from your history.

https://rtyley.github.io/bfg-repo-cleaner/

Riccardo Petraglia
  • 1,943
  • 1
  • 13
  • 25