0

I committed several large files and I got this error

gabbo@gabbo-SATELLITE-L750:/media/Data/Condiviso/TUe/Smartscope_study/smartscope_code$ git add -A
gabbo@gabbo-SATELLITE-L750:/media/Data/Condiviso/TUe/Smartscope_study/smartscope_code$ git commit -m "test"
# On branch master
nothing to commit (working directory clean)
gabbo@gabbo-SATELLITE-L750:/media/Data/Condiviso/TUe/Smartscope_study/smartscope_code$ git push origin master
WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-iLiKTe/pkcs11: No such file or directory
Username for 'https://github.com': gabboshow
Password for 'https://[email protected]': 
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$ 

after that I messed up with others

git add -A
git commit -m "xxx" 
git push origin master

I identified the files that cause problems. They are listed in a file called /large_files.txt in my git repository.

129281677 DATA/segmentation/Feat_1.mat
99053081 DATA/segmentation/Feat_2.mat
90017465 DATA/segmentation/Feat_5.mat
84251508 DATA/segmentation/Feat_4.mat
82775151 DATA/segmentation/Feat_6.mat
69845263 DATA/segmentation/Feat_7.mat
64768848 DATA/segmentation/Feat_3.mat

How can I proceed to delete the wrong commits and push a clean version of my repository?

20
  • 1
    You can reset your branch with --hard option to the point where files were not commited or you can do this stackoverflow.com/questions/23589167/… . Either way after you clean your local repo you can overwrite the remote branch with push -f or --force option (not every remote will allow you to do that it depends on the configuration). But from the error you've pasted it seems like your push has been declined so you probably only need to fix your branch locally. Commented May 13, 2014 at 8:57
  • Hi, I used the comment git filter-branch --tree-filter 'rm -rf DATA/*' HEAD and now I have in my repository a very old version of my code... could you please help me?? a bit desperate... Commented May 13, 2014 at 9:23
  • First see if you have actually pushed your changes to remote git checkout -b whatever_name_you_like origin/master and check the history. if it's ok then just delete your local branch and create a new one from origin/master. Commented May 13, 2014 at 9:31
  • can you tell me please how to do that? I'm new to git...anyway I'm pretty sure that I pushed after having used git-filter-branch. Commented May 13, 2014 at 9:34
  • To recap I tried to push large files, I continued working on my code, I used git-filter-branch as written above and pushed, I figured out that my code was an old copy. In the git repository I miss the part between the last correct push (before trying to push the large file) and the last one.. Commented May 13, 2014 at 9:35

1 Answer 1

1

"remote: error: File DATA/segmentation/Feat_1.mat is 123.29 MB; this exceeds GitHub's file size limit of 100 MB"

Your file DATA/segmentation/Feat_1.mat exceeds GitHub's maximum file size of 100MB and is therefore revoked. As what can be read from your questions, you have no "wrong" commits. You just failed at pushing to GitHub.

You may remove at least this too big file and commit the change. After that you'll be able to push to GitHub again.

If you must version control these large files i suggest you reading the help article on Working with large files.

If you want to keep these files in your project folder i recommend you to ignore them from now on:

Ignoring already tracked files

Add 'DATA/segmentation/*.mat' to your .gitignore (there's also a good help-resource on GitHub about that topic).

After that remove these tracked files from your repository using:

git rm --cached DATA/segmentation/*.mat

Which untracks the files and makes them now unknown to git.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.