2017-07-31 87 views
-1

測試服務器上的git存儲庫目錄大小爲1.1GB。 如何縮小目錄?Git目錄清理

方法。 腳本是在我的電腦上開發的。 由Jenkins上傳到Git存儲庫以測試要測試的服務器。 測試服務器上的Git目錄已增長到1.1GB,即目錄.git/objects。 我該如何減少它?

我可以直接刪除.git/objects的子目錄嗎? 或者這是由一個git命令處理?

在圖片中,運作的示意圖 enter image description here

問候

+1

[如何縮小.git文件夾]的可能重複(https://stackoverflow.com/questions/5613345/how-to-shrink-the-git-folder) – CodeCaster

+1

請閱讀[問]並分享您的研究。 – CodeCaster

回答

0

做時,這可能有助於混帳克隆嘗試淺克隆了一些有限的深度

 

git fetch --tags --progress https://github.com/org/project.git +refs/heads/*:refs/remotes/origin/* --depth=50 # timeout=10 

 

應減少大小的項目

0

我的方法和我的解決方案。
登錄「測試服務器」。
更改爲目錄/var/www/
首先,我做了以下

 dh -hs .git 

輸出1.1GB 然後

 git count-objects -v 

最後一個命令

 git repack -a -d --depth=500 --window=250 

我跟着從CodeCaster鏈接:how to shrink the .git folder