0

I have a data file that I recently put in my directory that's over the Github size limit. I forgot about the size limit, so did a git add / git commit / git push, and got the error saying it was too big.

To remedy this, I added a .gitignore file and specified the path to my file as well as removing the file in a separate git commit (git rm and then git commit).

However, when I tried to push again, it still tries to upload the file. The file does not come up in git ls-files. Any ideas? My .git directory is problematically big and indicates that the data file is still somewhere in there. What should I do?

phd
  • 82,685
  • 13
  • 120
  • 165
Liam Wilson
  • 179
  • 1
  • 9
  • See https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository. – ElpieKay Jul 01 '20 at 06:11
  • The file was committed, so in a past commit it exists. You should delete all commits with that file and re-make them. Since it's just one file, and it's like two commits ago, delete the last commit with the rm + gitignore. Delete again the commit with the large file. Add all files (but the large) to the staged list and create a new commit. Also, take the chance to insert the gitignore at this stage. IMHO no need for BFG or anything of the sort this time. Since the push didn't work, most likely you will be fine. – Daemon Painter Jul 01 '20 at 07:44
  • @DaemonPainter great -- this worked. – Liam Wilson Jul 01 '20 at 08:26
  • 1
    Glad to hear it. This means that it was closed incorrectly, and it is not a duplicate. – Daemon Painter Jul 01 '20 at 13:43

0 Answers0