尝试将存储库(包括历史记录)迁移出 Git LFS。
我在测试存储库上运行(在此处git lfs migrate export --include="*" --everything提到),但它没有按预期工作,并留下 LFS 指针文件,而不是将它们全部转换为对象。
我尝试了替代方法,遵循this。不幸的是它仍然留下指针文件,所以我将它与this结合起来。
最后,我什至将所有命令一起运行:
git lfs uninstall
git filter-branch -f --prune-empty --tree-filter '
git lfs fetch
git lfs checkout
git lfs ls-files | cut -d " " -f 3 | xargs touch
git lfs ls-files | cut -d " " -f 3 | xargs git rm --cached
git rm -f .gitattributes
git lfs ls-files | cut -d " " -f 3 | xargs git add --force
git add --renormalize .
' --tag-name-filter cat -- --all
没用。给我多个文件的以下错误,过滤的提交有指针文件而不是对象。
Errors logged to <PATH>
Use `git lfs logs last` to view the log.
Rewrite <COMMIT SHA ####> (2/9) (2 seconds passed, remaining 7 predicted)
Checking out LFS objects: 0% (0/1), 0 B | 0 B/s
Checking out LFS objects: 100% (2/2), 3.1 KB | 0 B/s, done
Error updating the git index:
error: picture.png: cannot add to the index - missing --add option?
fatal: Unable to process path picture.png
我尝试仅在提示提交上运行相同的命令,似乎touch, rm --cached, add --renormalize .,add --force不显示任何修改git status。所以我无法将清理/拉取的目标文件重新添加到新的提交中。
也许这就是问题所在?那么如何在使用filter-branch时强制将未更改的文件重新添加到索引中呢?
(使用带有 git bash 的 Windows。)