2013-02-28 35 views
12

我是Git新手,並且有一個相當大的項目,我想推送到Github上的遠程回購(Repo B)。原來的項目也在Github上,但是來自不同的回購(回購A)。我必須對Repo A中的文件進行一些更改,然後才能在Repo B上設置項目。我已設置遠程控制檯,ssh密鑰等,並在將代碼庫推送到Repo B時遇到問題。Github遠程推送包大小超過

我得到以下錯誤所有的時間:

$ git push <remote_repo_name> master 
Enter passphrase for key '/c/ssh/.ssh/id_rsa': 
Counting objects: 146106, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (35519/35519), done. 
fatal: pack exceeds maximum allowed size00 GiB | 154 KiB/s 
fatal: sha1 file '<stdout>' write error: Invalid arguments 
error: failed to push some refs to '[email protected]:<repo>.git 

我在當地gitconfig

git config pack.packSizeLimit 1g 
git config pack.windowMemory 1g 

改變以下設置......跑git的GC(我所看改組包,使每個包留在1GB的包裝內)。這不起作用,我得到上面的錯誤。

我試圖降低每包以及大小....

git config pack.packSizeLimit 500m 
git config pack.windowMemory 500m 

...跑git的GC(使每包留500MB的packsize內我所看的重組禮包)。這也不起作用,我遇到了同樣的錯誤。

我不確定Github的默認打包大小限制(如果有的話)。如果有問題,該賬戶是一個微型賬戶。

+0

你在Unix/Linux機器上嗎?如果是,請在工作存儲庫中鍵入'du -sk .'並將其添加到您的問題中。 [GitHub沒有限制](https://help.github.com/articles/what-is-my-disk-quota),但我很好奇你的二進制文件有多大。 – Makoto 2013-02-28 03:51:37

回答

15

packsize限制不會影響git協議命令(您的推送)。

git-configpack.packSizeLimit

一包的最大大小。此設置僅在重新打包時影響打包到文件,即git://協議不受影響

當執行push git時,無論大小如何,總會創建一個包!

爲了解決這個問題使用兩個(或更多)推動:

git push remoteB <some previous commit on master>:master 
... 
git push remoteB <some previous commit after the last one>:master 
git push remoteB master 

這些推都將有小包裝,並會取得成功。

+5

很好的答案 - 但我遇到了http://stackoverflow.com/q/28417845/1304104中描述的問題。基本上因爲遠程很乾淨,沒有任何分支設置,我不得不更具體地,和第一推動是以下形式的: 'GIT中推remoteB <一些先前提交於主>:參考文獻/頭/主'每500個提交(反向不跳過混合) – mbargiel 2015-06-29 19:59:58

+0

推: '最大= $(GIT日誌--oneline | WC-1); for i in $(seq $ max -500 1);做echo $ i; g = $(git log --reverse --oneline --skip $ i -n1 | perl -alne'print $ F [0]'); git push gh $ g:refs/heads/master; done' – rurban 2017-03-18 11:49:00