Git存储库克隆失败。丢失CR

时间:2015-07-20 06:48:26

标签: java eclipse git

嗨,任何人都可以建议任何解决方案。我正在尝试克隆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

请建议任何适当的解决方案,这将有助于我。 感谢

1 个答案:

答案 0 :(得分:1)

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

可能是“输入”选项。

来自git core.autocrlf

  • false:在您的提交中不执行任何操作
  • true:在提交中将所有crlf转换为lf,然后在结帐时将其转换为反面。
  • 输入:在提交中将所有crlf转换为lf,但在结账时保留lf。

您可以找到此参数写入的值:

git config core.autocrlf

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

git config --global core.autocrlf true