I have working with a file that exceeds Github's recommended maximum file (greater than 100 MB). I created a new file with less file size than original file and remove the old file. In that moment I run git add .
and then I commited all changes. When I tried to update all changes to remote repository but I get the following error:
Counting objects: 20, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (20/20), 67.36 MiB | 421.00 KiB/s, done.
Total 20 (delta 9), reused 0 (delta 0)
remote: Resolving deltas: 100% (9/9), completed with 2 local objects.
remote: warning: File datasets/credit_card_fraud_2.csv is 99.68 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 191376373d7e9d8b1db86eb399ea04f8
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File creditcard.csv is 143.84 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/Teett/fraud_detection_sura.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/Teett/fraud_detection_sura.git'
As you can see, the file name is "creditcard.csv". I search for some help in Google and I ran some of the following commands
git rm creditcard.csv
: but I get the errorfatal: pathspec 'creditcard.csv' did not match any files
.git add -u
andgit add -A
: but the push still showing the same error due to file size.git status
: it shows that the working tree is clean.
Notice that if I run git ls-files
, it shows:
.Rhistory
LICENSE
datasets/credit_card_fraud_1.csv
datasets/credit_card_fraud_2.csv
model_fraud_detection_logistic_1/coefs.csv
model_fraud_detection_logistic_1/credit_card.xls
model_fraud_detection_logistic_1/credit_card_script.Rmd
model_fraud_detection_logistic_1/default_payment_prob.png
model_fraud_detection_logistic_1/default_payment_probability.pdf
model_fraud_detection_logistic_1/default_payment_probability.png
model_fraud_detection_logistic_1/intervalos_confianza.pdf
model_fraud_detection_logistic_1/readme.docx
model_fraud_detection_logistic_2/fraud_detection_credit_card.Rmd
But the file "creditcard.csv" is not listed.
I am looking for a way to update the git registers to keep the tracking files as I have showed when I ran git ls-files
command. If necessary I don't want to keep tracking the older versions of files. Or I am looking for a way to ignore this problematic file in the push command.