2017-02-22 86 views
0

我已將我的存儲庫遷移到LFS,並發現.git/lfs/objects太大。 我可以配置lfs不要在那裏存儲任何東西,如果需要將文件直接下載到存儲庫文件夾?沒有本地存儲的git lfs

回答

0

看來這是不可能的。看看git的-LFS official specification

... 

The smudge filter runs as files are being checked out from the 
Git repository to the working directory. Git sends the content 
of the Git blob as STDIN, and expects the content to write to 
the working directory as STDOUT. 

- Read 100 bytes. 
- If the content is ASCII and matches the pointer file format: 
    . Look for the file in .git/lfs/objects/{OID-PATH}. 
    . If it's not there, download it from the server. 
    . Write its contents to STDOUT 
- Otherwise, simply pass the STDIN out through STDOUT. 

... 
+0

如果我們正確後「寫它的內容輸出到標準輸出」,它將實現這個目標添加「刪除文件」。我錯了嗎? – Michael

+0

你打算怎麼做?實際上,你可以定期刪除.git/lfs/objects(cron)。 –

+0

這取決於git-lfs開發者。他們可以添加另一個標誌並跳過存儲下載的數據。我認爲這是相當簡單的方法。 對於cron--它不能在「組織」級別完成。 – Michael