我正在尝试使用git lfs migrate import --no-rewrite修复丢失指针的问题首先我使用git reset --hard列出了所有丢失指针的文件
new Promise((resolve, reject) => {
exec("git reset --hard", (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
reject(error);
return;
}
const filesWithMissingPointers = Array.from(
stderr.matchAll(/\t(.*)/g)
).map((m) => m[1]);
resolve(filesWithMissingPointers);
});
});然后记录输出:
console.log(
`Problem files before lfs migrating: \t\n${problemFilesBefore.join("\t\n")}`
);输出:
Problem files before lfs migrating:
IdleGame/Assets/Plugins/Fonts/Localization/Korean/NotoSansCJKkr-Medium.otf
IdleGame/Assets/Plugins/Fonts/Localization/Latin_Cyrillic_Greek/OctoberPro-Black.otf
IdleGame/Assets/Plugins/Fonts/Localization/Latin_Cyrillic_Greek/OctoberPro-HeavyItalic.otf
IdleGame/Assets/Plugins/Fonts/Localization/Persian/NotoNaskhArabicUI-Bold.ttf
IdleGame/Assets/Plugins/Fonts/Localization/Thai/NotoSansThaiUI-CondensedMedium.ttf
IdleGame/Assets/Plugins/Fonts/Oswald-Bold.ttf
IdleGame/Assets/Plugins/Fonts/PoetsenOneRegular/TrueType font file/PoetsenOne-Regular 1.ttf
IdleGame/Assets/Plugins/Fonts/Roboto Medium/TrueType font file/roboto-medium.ttf
IdleGame/Assets/Plugins/Fonts/nevis.ttf
IdleGame/Assets/Plugins/LibrariesDesign/BeautifulDissolves/_Examples/_Assets/Textures/ZomBearSpecular.tif
IdleGame/Assets/Plugins/LibrariesDesign/BeautifulDissolves/_Examples/_Assets/Textures/ZomBunnySpecular.tif然后我试着运行:
execSync(
`git lfs migrate import --no-rewrite \ -m "AutoCommit Bot: fix missing LFS points ${process.env.CI_PIPELINE_URL}" ${problemFilesBefore.join(" ")} --yes`
);我遇到了:
Error: unknown flag: --no-rewrite在powershell中运行该命令时,我在本地遇到了同样的问题,但在bash中运行它时,我没有遇到这个问题。我的脚本在安装了git lfs的docker容器(linux)中运行。因为它是Unix,所以它应该使用bash作为默认命令行,所以我不认为问题出在shell上。
注意:我在gitlab上将此脚本作为作业运行
发布于 2020-09-08 05:01:53
--no-rewrite标志在GitLFS2.3.4中不可用。Git LFS有一个相当积极的发布过程,因此在版本之间添加了许多新功能,通常每3个月发布一次。
如果你使用的是Ubuntu 18.04,你可能会想升级到20.04,或者至少使用更新的版本。Git LFS项目提供了额外的二进制文件和包,如果您不喜欢升级操作系统,您可以使用它们。
如果你正在使用Windows做某些事情,你应该升级你的Git for Windows版本。Git LFS随Git for Windows一起提供,获得更新版本的最简单方法是升级Git。手动安装较新的版本很棘手,因为很难覆盖内置版本。
https://stackoverflow.com/questions/63780802
复制相似问题