gpt4 book ai didi

java - Git 存储库克隆失败。缺少 CR

转载 作者:行者123 更新时间:2023-11-30 11:00:30 25 4
gpt4 key购买 nike

您好,任何人都可以就此提出任何解决方案。我正在尝试克隆 git 存储库,但每次我都会收到上述消息。这是我收到的日志。

org.eclipse.jgit.api.errors.TransportException: missing CR
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139)
at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:178)
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:125)
at org.eclipse.egit.core.op.CloneOperation.run(CloneOperation.java:156)
at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard.executeCloneOperation(AbstractGitCloneWizard.java:433)
at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard.access$2(AbstractGitCloneWizard.java:426)
at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard$5.run(AbstractGitCloneWizard.java:387)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: org.eclipse.jgit.errors.TransportException: missing CR
at org.eclipse.jgit.transport.BasePackFetchConnection.doFetch(BasePackFetchConnection.java:370)
at org.eclipse.jgit.transport.TransportHttp$SmartHttpFetchConnection.doFetch(TransportHttp.java:783)
at org.eclipse.jgit.transport.BasePackFetchConnection.fetch(BasePackFetchConnection.java:301)
at org.eclipse.jgit.transport.BasePackFetchConnection.fetch(BasePackFetchConnection.java:291)
at org.eclipse.jgit.transport.FetchProcess.fetchObjects(FetchProcess.java:247)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:160)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1115)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
... 7 more
Caused by: java.io.IOException: missing CR
at sun.net.www.http.ChunkedInputStream.processRaw(Unknown Source)
at sun.net.www.http.ChunkedInputStream.readAheadBlocking(Unknown Source)
at sun.net.www.http.ChunkedInputStream.readAhead(Unknown Source)
at sun.net.www.http.ChunkedInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
at org.eclipse.jgit.util.io.UnionInputStream.read(UnionInputStream.java:145)
at java.io.FilterInputStream.read(Unknown Source)
at org.eclipse.jgit.util.io.TimeoutInputStream.read(TimeoutInputStream.java:112)
at org.eclipse.jgit.transport.SideBandInputStream.read(SideBandInputStream.java:143)
at org.eclipse.jgit.transport.PackParser.fill(PackParser.java:1131)
at org.eclipse.jgit.transport.PackParser.access$000(PackParser.java:97)
at org.eclipse.jgit.transport.PackParser$InflaterStream.read(PackParser.java:1663)
at java.io.InputStream.read(Unknown Source)
at org.eclipse.jgit.transport.PackParser.whole(PackParser.java:983)
at org.eclipse.jgit.transport.PackParser.indexOneObject(PackParser.java:916)
at org.eclipse.jgit.transport.PackParser.parse(PackParser.java:487)
at org.eclipse.jgit.internal.storage.file.ObjectDirectoryPackParser.parse(ObjectDirectoryPackParser.java:194)
at org.eclipse.jgit.transport.PackParser.parse(PackParser.java:448)
at org.eclipse.jgit.transport.BasePackFetchConnection.receivePack(BasePackFetchConnection.java:762)
at org.eclipse.jgit.transport.BasePackFetchConnection.doFetch(BasePackFetchConnection.java:363)
... 15 more

请提出任何合适的解决方案来帮助我。谢谢

最佳答案

这似乎与 autocrlf 核心选项有关。

它可能在“输入”选项中。

来自 git core.autocrlf :

  • false:在你的提交中什么都不做
  • true:将提交中的所有 crlf 转换为 lf,反之亦然。
  • 输入:在提交中将所有 crlf 转换为 lf,但在 checkout 时保留 lf。

这个参数的值可以这样写:

git config core.autocrlf

在您的情况下,请尝试将 autocrlf 设置为“true”。这应该将存储库的 lf 更改为工作目录中的 crlf。

git config --global core.autocrlf true

关于java - Git 存储库克隆失败。缺少 CR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31510275/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com