2013-06-29 28 views
22

截至2013年6月18日的這一更改如何影響我的現有存儲庫,且文件超過了此限制?我在2個月前推出了一個大文件。Github文件大小上限改爲6/18/13。現在無法推送

我有一個大文件,我已經在本地刪除,但現在我無法推送任何東西。我得到一個「遠程錯誤」...遠程:錯誤:文件cron_log.log是126.91 MB;這超過了100 MB

我說原來推後的.gitignore文件GitHub的文件大小限制......但它仍然存在於遠程(產地)

刪除其本地應在原產地擺脫它( Github)對不對? ......但它不是讓我推,因爲有超過限制在Github上一個文件...

https://github.com/blog/1533-new-file-size-limits

這是我發出的加錯誤信息的命令..

 
git add . 
git commit -m "delete cron_log.log" 
git push origin master 

remote: Error code: 40bef1f6653fd2410fb2ab40242bc879 
remote: warning: Error GH413: Large files detected. 
remote: warning: See http://git.io/iEPt8g for more information. 
remote: error: File cron_log.log is 141.41 MB; this exceeds GitHub's file size limit of 100 MB 
remote: error: File cron_log.log is 126.91 MB; this exceeds GitHub's file size limit of 100 MB 

To https://github.com/slinds(omited_here)/linexxxx(omited_here).git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://github.com/slinds(omited_here) 

我又試圖之類的東西

git rm cron_log.log 
git rm --cached cron_log.log 

同樣的錯誤。

+2

你能用命令解釋你到目前爲止刪除文件的過程嗎? – manojlds

+0

是的,請發佈您正在運行的命令以及這些命令的輸出。 –

+0

'git log --oneline @ {u} .. HEAD'和'find的輸出是什麼? -iname'cron_log.log''? – Chronial

回答

21

由於rlb.usa指出,Github增加了一個文件大小限制,可以防止您推送大於100MB的文件。您試圖在新提交中刪除該文件並試圖推送該文件。這失敗了,因爲你不只是推動最後一次提交,還有三次提交。這三個提交包含141MB和126MB大小的cron_log版本。他們導致你的推動失敗。

爲了解決這個問題,你有兩個選擇:

  • 運行git rebase -i origin/master,設置每一個承諾編輯和刪除在每個文件與git commit --amend
  • 使用BFG Repo-Cleaner清理所有歷史記錄。
+4

在這裏使用tortoiseGit成功擺脫他們的大文件。我選擇了取而代之的Pull和Rebase,我得到了衝突文件列表。刪除有問題的文件,承諾,推動,它的工作 –

3

據GitHub的new file size limit(也:working with large files),提起幾個小時前,GitHub上現在有超過50 MB的文件推送和100MB的文件上傳完全拒絕了1GB的文件大小信息庫的新政策,警告。

GitHub warns you when you push a file larger than 50 MB. We'll reject pushes containing files larger than 100 MB. We do this for a few reasons.

您有幾種選擇,但不是很多:

  • 上傳100 MB +文件到不同的服務,並與替代
  • 共享減少問題的文件,文件大小
  • 查找一個新的存儲庫
+8

我只是想擺脫文件...我似乎無法做到這一點。 – slindsey3000

+1

@ slindsey3000我知道。我們也有這個問題。我記得聽說有些人通過聯繫GitHub支持 –

+1

您忘記拆分並重新組合文件 –

26

嗨,你可以用這種方法輕鬆解決:

git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch FILENAME.TAR' --prune-empty --tag-name-filter cat -- --all

鏈接:https://help.github.com/articles/remove-sensitive-data

+0

這真棒!謝謝!! – collenjones

+0

如果你使用cocapods,因爲它可以取消你所有的豆莢鏈接,所以要小心使用它,這是很難學會的。 – jusynth

1

對GitHub上的每個文件的實際限制爲100個MIB,而不是100 MB。

演示:https://github.com/Franck-Dernoncourt/github-max-file-size


https://help.github.com/articles/what-is-my-disk-quota/mirror)錯誤地聲稱他們放置文件大小超過

MB和MIB之間的混亂可推動時可以看到100 MB的一個嚴格的限制:在下面的例子中,來自GitHub服務器的錯誤信息表明文件爲101 MB,而git正確表明它是101 MiB:

~\Documents\GitHub\test123 [master ↑1 +3 ~0 -0 !]> git push 
Counting objects: 3, done. 
Delta compression using up to 8 threads. 
Compressing objects: 100% (3/3), done. 
Writing objects: 100% (3/3), 101.03 MiB | 896.00 KiB/s, done. 
Total 3 (delta 1), reused 0 (delta 0) 
remote: Resolving deltas: 100% (1/1), completed with 1 local objects. 
remote: error: GH001: Large files detected. You may want to try Git Large File S 
torage - https://git-lfs.github.com. 
remote: error: Trace: e9206a9cd05c4ff5de79bba9d4caf9df 
remote: error: See http://git.io/iEPt8g for more information. 
remote: error: File 101MB is 101.00 MB; this exceeds GitHub's file size limit of 
100.00 MB 
To https://github.com/Franck-Dernoncourt/test123.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://github.com/Franck-Dernoncourt/test12 
3.git' 
~\Documents\GitHub\test123 [master ↑1 +3 ~0 -0 !]> 
0

我嘗試了幾個沒有運氣的上述答案。但最終我找到了一個使用Github Desktop的解決方案。點擊'Repository','撤消最近的提交'。它允許我做兩次,就足以刪除違規提交。 (我已經從存儲庫中刪除了大文件)。

+0

OP在命令行中使用'git'。 –