我正在使用超过Github建议的最大文件(大于100 MB)的文件。我创建了一个文件大小小于原始文件的新文件,并删除了旧文件。在那一刻,我运行git add .
,然后提交了所有更改。当我尝试更新对远程存储库的所有更改时,出现以下错误:
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'
如您所见,文件名为“ creditcard.csv”。我在Google中寻求帮助,并运行了以下一些命令
git rm creditcard.csv
:但是出现错误fatal: pathspec 'creditcard.csv' did not match any files
。git add -u
和git add -A
:但是由于文件大小,推送仍然显示相同的错误。git status
:表明工作树是干净的。请注意,如果我运行git ls-files
,它将显示:
.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
但是未列出文件“ creditcard.csv”。
我正在寻找一种更新git寄存器的方法,以保持跟踪文件的运行,如我在运行git ls-files
命令时所显示的那样。如有必要,我不想继续跟踪较旧版本的文件。或者,我正在寻找一种在push命令中忽略此有问题文件的方法。