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?
git checkout -b whatever_name_you_like origin/masterand check the history. if it's ok then just delete your local branch and create a new one from origin/master.