簡體   English   中英

rsync git big repository

[英]rsync git big repository

我正在嘗試將git存儲庫克隆到我的本地計算機上,但它說“ malloc failed ”,因為存儲庫太大了。

有誰知道我可以用來復制目錄的確切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 clone時出現以下錯誤:

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

只需使用更新版本的git 較新的版本可以處理這個問題。 或者,如果您已經使用新版本,請將git config core.bigFileThreshold設置為較小的大小。

嘗試使用ulimit允許git進程使用更多內存。

  • ulimit -m XXX
  • ulimit -v YYY

如果你有一個非常大的文件,我不認為你有任何其他選擇,但試圖從你的回購中刪除它,假設:

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

請參閱Pro Git一書中的“從每個提交中刪除文件”部分

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

另請參閱git filter-branch “縮小存儲庫清單”部分

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM