2017-06-14 23 views
2

我試圖將現有的git repo轉換爲使用git lfs。我下面Atlassian's recipe,這裏使用BFG工具:https://rtyley.github.io/bfg-repo-cleaner/無法通過bfg工具將git repo轉換爲使用大文件支持(lfs)

的問題是,當我發出建議的命令來執行實際的轉換,它結束幾乎立刻做了不實際工作:

C:\src> java -jar bfg-1.12.15.jar --convert-to-git-lfs '*.{msi,7z,gz,zip,bin,exe,psd,pdf}' --no-blob-protection ent.git` 

Using repo : C:\\src\\ent.git 

Found 0 objects to protect 
Found 35 tag-pointing refs : refs/tags/4.2/4.2.0, refs/tags/4.2/4.2.1, refs/tags/4.2/4.2.2, ... 
Found 145 commit-pointing refs : HEAD, refs/heads/ESP-1652-filetransformer-throws-system.invalidoperationexception, refs/heads/archive/cmdev, ... 

Protected commits 
----------------- 

You're not protecting any commits, which means the BFG will modify the contents of even *current* commits. 

This isn't recommended - ideally, if your current commits are dirty, you should fix up your working copy and commit that, check that your build still works, and only then run the BFG to clean up your history. 

Cleaning 
-------- 

Found 11182 commits 
Cleaning commits:  100% (11182/11182) 
Cleaning commits completed in 782 ms. 

BFG aborting: No refs to update - no dirty commits found?? 

我我在Windows 10 btw上。使用git版本2.9.2.windows.1

任何想法?

回答

0

我發現了這個問題。 BFG工具需要在參數中有雙引號。不像Atlassian樣本中的單引號。也許只有Windows的問題?

FYI:工作命令則是:

java -jar bfg-1.12.15.jar --convert-to-git-lfs "*.{msi,7z,gz,zip,bin,exe,psd,pdf}" --no-blob-protection ent.git

+0

刪除:是的,它似乎是一個cygwin問題。 –

0

如果你有這個問題,它的不會造成錯誤類型的引號,因爲它是@Spiralis,也許你已經有了和我一樣的問題。我在Cygwin上運行它,但它不起作用。在正常的Windows命令提示符下運行它以給定的格式爲我工作。