2011-08-23 70 views
3

我想將git存儲庫克隆到本地計算機上,但它說「malloc failed」,因爲存儲庫太大。rsync git big repository

有誰知道我可以用來複制目錄的確切rsync命令?或者還有什麼我可以做的克隆大型資料庫?

我試圖rsyncing但它給我下面的錯誤:

Invalid command: 'rsync --server --sender -v . username/dir.git' 
    You appear to be using ssh to clone a git:// URL. 
    Make sure your core.gitProxy config option and the 
    GIT_PROXY_COMMAND environment variable are NOT set. 
rsync: connection unexpectedly closed (0 bytes received so far) [receiver] 
rsync error: error in rsync protocol data stream (code 12) at io.c(463) [receiver=2.6.8] 

試圖使用git克隆時,我得到了以下錯誤:

remote: Counting objects: 52708, done. 
remote: Compressing objects: 100% (52188/52188), done. 
fatal: Out of memory, malloc failed (tried to allocate 1471836719 bytes) 
fatal: index-pack failed 
+0

你可以在'git config --global http.postBuffer 524288000'之後再次嘗試你的克隆命令,如http://stackoverflow.com/questions/6842687/the-remote-end-hung-up-unexpectedly -while-git的克隆/ 6849424#6849424? – VonC

+0

@VonC - 你不應該問首先使用哪種協議嗎?如果正在使用ssh/git,那麼設置無關緊要? – manojlds

+0

你真的使用'rsync'來克隆它嗎? :? – KingCrunch

回答

2

只是使用較新版本的git。較新的版本可以處理這個問題。 或者,如果您已經在使用新版本,請將git config core.bigFileThreshold設置爲較小的尺寸。

+0

我不知道關於那個特定的設置。 +1 – VonC

0

嘗試使用的ulimit,讓更多的內存是由git進程使用。

  • 的ulimit -m XXX
  • 的ulimit -v YYY
+0

沒有工作。仍然是相同的錯誤 – Jasmine

0

如果你有一個真正的大文件,我不認爲你有任何其他選項,但試圖移除從您的回購,assumming:

  • 您可以訪問遠程服務器
  • 沒有其他人設法克隆它(因爲它會改變流程中的歷史記錄,這會使現有的克隆產生任何未來的問題)。

查看section "Removing a File from Every Commit" from the Pro Git book

git filter-branch --tree-filter 'rm -f bigFile' -- --all 

檢查也是section "Checklist for Shrinking a Repository" of git filter-branch

+0

我不認爲你可以做到這一點與遠程存儲庫。(Naissa的嘗試創建一個本地克隆。)什麼讓你認爲沒有人能夠克隆存儲庫嗎? –

+1

@Christopher:是什麼讓我覺得沒有人能夠克隆那個回購是在我剛開始回答這個問題時的凌晨;) – VonC

相關問題