2

In my git repository I have a folder (DATA) containing other folders containing large files. I created a .gitignore file with the following text

DATA/

I tried to update the files in my repository and I got this error anyway

remote: warning: File DATA/segmentation/Feat_2.mat is 94.46 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: warning: File DATA/segmentation/Feat_3.mat is 61.77 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: warning: File DATA/segmentation/Feat_4.mat is 80.35 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: warning: File DATA/segmentation/Feat_5.mat is 85.85 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: warning: File DATA/segmentation/Feat_6.mat is 78.94 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: warning: File DATA/segmentation/Feat_7.mat is 66.61 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: error: GH001: Large files detected.
remote: error: Trace: 66ef415089784516b0d76ac2e639a7ac
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File DATA/segmentation/Feat_1.mat is 123.29 MB; this exceeds GitHub's file size limit of 100 MB
To https://github.com/gabboshow/smartscope_code.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/gabboshow/smartscope_code.git'
gabbo@gabbo-SATELLITE-L750:/media/Data/Condiviso/TUe/Smartscope_study/smartscope_code$ 

How can I fix the git push and continue committing my files ignoring all the files in the folder DATA?

Cœur
  • 37,241
  • 25
  • 195
  • 267
gabboshow
  • 5,359
  • 12
  • 48
  • 98

1 Answers1

1

It seems you committed files in DATA, and then added it to the .gitignore, didn't you?

Ignoring an already committed file is a Git FAQ. The short answer is:

.gitignore only applies to untracked files, i.e. files that have never been committed (or even git added).

See for example: Applying .gitignore to committed files

You will have to remove the large files from your repository to be able to push. Note that you must remove them from the history as well (by rewriting history); deleting them in a new commit is not enough.

Github has a nice page on how to do this, linked in your error message: https://help.github.com/articles/working-with-large-files

Community
  • 1
  • 1
sleske
  • 81,358
  • 34
  • 189
  • 227
  • Thanks, but when I run java -jar bfg.jar --strip-blobs-bigger-than 50M I get Unable to access jarfile bfg.jar – gabboshow May 13 '14 at 08:05
  • 1
    @gabboshow: Sounds like you are not invoking bfg.jar correctly. Try invoking it with its full filesystem path. If you keep having problems, ask a new question. – sleske May 14 '14 at 07:03