1

I have been trying to push changes to my GitHub repo but been facing this problem:

Uploading LFS objects: 100% (164/164), 153 MB | 0 B/s, done.                    
Enumerating objects: 25977, done.
Counting objects: 100% (25968/25968), done.
Delta compression using up to 4 threads
Compressing objects: 100% (18133/18133), done.
Writing objects: 100% (25955/25955), 146.83 MiB | 232.00 KiB/s, done.
Total 25955 (delta 6561), reused 25816 (delta 6463)
remote: Resolving deltas: 100% (6561/6561), 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: 9f797e9b5f7a1c01fca6706ad62e21ba
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File venv/lib/python3.6/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so is 225.31 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/yovelcohen/nba-stats.git
 ! [remote rejected]   master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/yovelcohen/nba-stats.git'
(base) yovel@the-beastpad:~$ cd venv/lib/python3.6/site-packages/tensorflow_core/python/

bash: cd: venv/lib/python3.6/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so: No such file or directory

I imported TensorFlow to the project but then removed it, when trying to delete it from the terminal it's not there (and when looking for it manually).

any help would be appreactied!

  • What does `git status` say? – zvone Dec 02 '19 at 22:46
  • If you have already committed the large file(s), try committing the delete operation and pushing again – Madhu Bhat Dec 02 '19 at 23:06
  • ``` (base) yovel@:~/PycharmProjects/nba_stats$ git restore venv/lib/python3.6/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so error: pathspec 'venv/lib/python3.6/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so' did not match any file(s) known to git ``` –  Dec 06 '19 at 18:23
  • just to clarify, did you remove it locally but its still on your git repo? or the other way around? – alex067 Dec 08 '19 at 14:40
  • @yovelcohen I suggest adding a .gitignore file to your repo. You can use this sample: https://github.com/github/gitignore/blob/master/Python.gitignore – aaron Dec 08 '19 at 14:59

1 Answers1

0

Since you should not push any generated binary file anyway, start first by removing them locally, commit and push:

 git rm -r '*.so' -f
 echo '*.so' >> .gitignore

But if that still fails, it means you are trying to push past commits (not just the latest one) with *.so files, even though the last commit no longer includes any such files.

If that is the case, since git filter-branch is soon deprecated, consider newren/git-filter-repo to remove any large files like those *.so ones, before pushing (or force pushing of that rewrites the content of past commits previously pushed).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250