1

I know this question comes up a lot, apologies for it... but I have read many entries here on StackOverflow but I have not been able to make any of them work. So here it comes once again, hoping to get some guidance...

Background: I am working alone in a project. I have always had my repo on GitHub and it has always worked well. Basically I did not have any problems pushing and pulling from the master. This time I had a large file +173MB so I decided to try the Git Large File Storage that always pops up. The process I followed is the one it says on the website:

brew install git-lfs
git lfs install
git lfs track "*.csv" (my file is a csv)
git add .gitattributes

After doing this, I was not able to push to the master anymore. The message is:

(venv-MBTI) (base) diego@DIGL Capstone 2 - MBTI % git push origin master
Uploading LFS objects: 100% (1/1), 345 B | 0 B/s, done.
Enumerating objects: 146, done.
Counting objects: 100% (135/135), done.
Delta compression using up to 4 threads
Compressing objects: 100% (116/116), done.
Writing objects: 100% (120/120), 59.90 MiB | 634.00 KiB/s, done.
Total 120 (delta 25), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (25/25), completed with 7 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: cb2e700c19f2bdbb2ca9aeb2df53605a
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File data/mbti_interim is 173.20 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/DSJourney/MBTI.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/DSJourney/MBTI.git'

I tried most of the stuff I found in StackOverflow:

git pull --rebase
git reset --soft HEAD~1
git revert a2f2db2 (an older commit)
git push -u origin master

I also tried to follow

  • the instructions from here
  • the instructions from here

Other less relevant stuff

I guess I am doing something wrong, but have not been able to figure it out.

Any suggestion?

JourneyDS
  • 113
  • 14
  • `File data/mbti_interim is 173.20 MB`. Try `git lfs track data/mbti_interim`. – ElpieKay Jul 29 '20 at 03:46
  • Thanks for the suggestion ElpieKay, but it did not solve it, the same message pops up... – JourneyDS Jul 29 '20 at 15:35
  • 1
    1. Back up `data/mbti_interim`. If it has many versions, just clone the local repository to another path. 2. Remove `data/mbti_interim` from the history (see https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository). 3. Use `git lfs` to track `data/mbti_interim`. – ElpieKay Jul 30 '20 at 02:21
  • 1
    Thanks ElpieKay, I think the problem was that there were many versions like you said. I had not seen your message so I went forward and deleted the GitHub repo and created a new one. Having looked at your suggestion it seem like that was the correct solution. Thanks for taking the time to deal with this. – JourneyDS Jul 30 '20 at 17:53

1 Answers1

0

There were two proposed solutions, the right one was suggested by ElpieKay:

  1. Back up data/mbti_interim. If it has many versions, just clone the local repository to another path.
  2. Remove data/mbti_interim from the history (LINK)
  3. Use git lfs to track data/mbti_interim

I had not seen that answer so my solution was to erase the GitHub repo altogether and start a new one without the file.

JourneyDS
  • 113
  • 14