我正在尝试将我们的Git repo迁移到LFS,如下所示:
java -jar git-lfs-migrate.jar -s our-repo.git -d our-repo-small.git -l https://user:password@bitbucket.example.com/bitbucket/scm/example/our-repo.git "*.jar"
为存储库启用了LFS,但我得到了:
[main] INFO git.lfs.migrate.Main - LFS server: Batch API request exception
ru.bozaro.gitlfs.client.exceptions.RequestException: https://user:password@bitbucket.example.com/bitbucket/scm/example/our-repo.git/objects/batch - 501 (Not Implemented)
at ru.bozaro.gitlfs.client.Client.doRequest(Client.java:315)
at ru.bozaro.gitlfs.client.Client.lambda$postBatch$7(Client.java:118)
at ru.bozaro.gitlfs.client.Client.doWork(Client.java:252)
at ru.bozaro.gitlfs.client.Client.postBatch(Client.java:118)
at git.lfs.migrate.Main.checkLfsAuthenticate(Main.java:113)
at git.lfs.migrate.Main.main(Main.java:66)
[main] ERROR git.lfs.migrate.Main - LFS server: Invalid base URL
我们正在使用Bitbucket v4.6.2但是我在Bitbucket更改日志中找不到任何与之相关的东西。
我做错了吗?或者git-lfs-migrate是否使用了Bitbucket尚未实现的功能?如果是这样,有没有解决方法?我假设我不是第一个这样做的人: - )
答案 0 :(得分:2)
感谢a comment in the git-lfs-migrate issue tracker:
,我设法解决了这个问题git clone --mirror ./path/to/repo.git
java -jar git-lfs-migrate.jar \ -s repo.git \ -d repo-converted.git \ "*.psd"
cd repo-converted.git
git fsck
git remote add origin https://github.com/user/repo-converted.git
git push origin master # (or git push --all origin)
git lfs push --all origin
基本上,您只需在本地创建所有LFS文件,然后手动将它们推送到LFS服务器。
答案 1 :(得分:0)
以下对我有用:
java -jar git-lfs-migrate.jar \
-s repo.git \
-d repo-converted.git \
-g https://usename:password@bitbucket.org/user/repo-converted.git \
"*.png"