2

我正在尝试将现有的 git repo 转换为使用 git lfs。我正在关注Atlassian 的食谱,在这里使用 BFG 工具:https ://rtyley.github.io/bfg-repo-cleaner/

问题是,当我发出建议的命令进行实际转换时,它几乎立即结束,没有完成任何实际工作:

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 顺便说一句。使用 git 版本2.9.2.windows.1

有任何想法吗?

4

2 回答 2

1

如果您遇到此问题并且不是由 @Spiralis 的错误类型的引号引起的,那么您可能遇到了与我相同的问题。我在 Cygwin 中运行它,但它不起作用。在正常的 Windows 命令提示符下运行它对我来说是给定的格式。

于 2017-07-27T07:15:12.797 回答
0

我发现了问题。BFG 工具需要在参数中使用双引号。不是 Atlassian 示例中的单引号。也许只是 Windows 的问题?

仅供参考:工作命令是:

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

于 2017-06-14T17:22:00.817 回答