git - 使用 JGit 克隆 Git 存储库时如何修复“Packfile is truncated”错误
问题描述
我正在尝试使用标签名称和 SSH 协议使用 JGit API 克隆 Git 存储库。当我克隆时面临“Packfile 被截断”错误。
存储库有大约 10 GB 的数据。网络不间断且快速。
有谁知道可能是什么问题?
CloneCommand command = Git.cloneRepository();
command.setTransportConfigCallback(transport -> {
SshTransport sshTransport = (SshTransport) transport;
sshTransport.setSshSessionFactory(SSHSessionFactory);
});
command.setDirectory(new File("gitRootFolder"));
command.setBranchesToClone(Arrays.asList(gitBranchName));
command.setBranch(gitTagName);
command.setCloneSubmodules(true);
Git git = command.call();
git.close();
解决方案
推荐阅读
- python - 请告诉我如何在不使用 jupyter notebook 的情况下使用 TensorBoard Projector
- c# - 发布我的 API PUT 方法后显示 400 Bad Request?
- algorithm - 具有多个不同源和汇的最大流量
- c++ - VSCode 上的错误代码块。它找不到 add_definitions(-D_MYDEF)
- firebase - 如何在cordova中创建一个事件,该事件应在firebase实时数据库中的孩子发生变化时触发
- json - Nuget 拉取错误版本的 System.Runtime.CompilerServices.Unsafe.dll
- python - 在 Python 中,我有两个不同的文件
- javascript - 如何在反应原生中格式化数字输入,其中每盒有一个数字,用于 6 个盒子?
- sycl - 在 dpc++ malloc_shared 我们可以在 2 个 gpus 之间共享一个缓冲区吗
- php - 即使客户端从前端更改了数据属性值,如何从购物车中删除相关商品?