2

I added a file in my older commit and without pushing that commit then I deleted that file from the dir. After that I did more changes and added more commits and now every time I try to push the code I face this error when I do git push -u origin master

Counting objects: 58, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (58/58), done.
Writing objects: 100% (58/58), 197.83 MiB | 370.46 MiB/s, done.
Total 58 (delta 44), reused 0 (delta 0)
remote: Resolving deltas: 100% (44/44), completed with 10 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: 7db8d77e8595ae0da9cc34aa2ab1c4d0
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File public/uploads.zip is 197.85 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/repo-name
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/repo-name'

The file mentioned uploads.zip has been deleted before manually. so this file does not exist in the dir.

When I do git log origin/master..master i don't even see the file in the list.

Here is the result of git status link

StealthTrails
  • 2,281
  • 8
  • 43
  • 67

1 Answers1

2

If your git repo keeps trying to upload large files, you might want and check for any tracked (and later deleted) large files.

Use BFG Repo cleaner and see if, in your history, you don't have some files to remove.

Remove all blobs bigger than 10 megabytes :

$ bfg --strip-blobs-bigger-than 10M  my-repo.git 

# or

java -jar bfg.jar --strip-blobs-bigger-than 100M some-big-repo.git
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • right now I get this error `Error: Unable to access jarfile bfg-1.12.13` – StealthTrails Oct 01 '16 at 12:42
  • @Adamnick you can use the second form `java -jar bfg.jar --strip-blobs-bigger-than 100M some-big-repo.git`. Of course, replace `bfg.jar` by the full path of the jar you have downloaded from http://repo1.maven.org/maven2/com/madgag/bfg/1.12.13/bfg-1.12.13.jar – VonC Oct 01 '16 at 14:12
  • I am using the second version already, is there any other method? – StealthTrails Oct 01 '16 at 14:13
  • @Adamnick no just use the correct path for the jar: `Unable to access jarfile bfg-1.12.13` means the cmd line does not find `bfg-1.12.13.jar` – VonC Oct 01 '16 at 14:14
  • @Adamnick and make sure to use a --mirror cloned repo, that is a bare repo, as per BFG usage instructions: https://rtyley.github.io/bfg-repo-cleaner/#usage – VonC Oct 01 '16 at 14:16
  • @Adamnick see for instance https://github.com/rtyley/bfg-repo-cleaner/issues/33#issuecomment-86718607 – VonC Oct 01 '16 at 14:17
  • this file `public/uploads.zip` does not even exist on my dir anymore but git is still uploading God knows whats happening. – StealthTrails Oct 01 '16 at 14:33
  • 1
    @Adamnick note that you won't file any big file in your working tree: the idea of bfg is to look for big files in your history of commits. If 10MB doesn't yield anything, try 1MB. – VonC Oct 01 '16 at 18:13