git git存档致命:协议不支持的操作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11258599/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 07:09:14  来源:igfitidea点击:

git archive fatal: Operation not supported by protocol

gitgit-checkoutgit-archive

提问by Sly

I'm trying to checkout part of remote git repository. As recommended here, with help of command

我正在尝试检出远程 git 存储库的一部分。按照这里的建议,在命令的帮助下

git archive --format=zip --remote=http://path_to_repository

But I'm getting error message:

但我收到错误消息:

fatal: Operation not supported by protocol.
Unexpected end of command stream

Git is not supporting this operation with http protocol? Thats a problem of hosting environment or git itself? Any directions would help, thanks.

Git 不支持 http 协议的这个操作?那是托管环境的问题还是git本身的问题?任何方向都会有所帮助,谢谢。

回答by J-16 SDiZ

git archivecan work with a server with git protocol support (i.e. git server, smart-httpand ssh server).

git archive可以使用支持 git 协议的服务器(即 git 服务器、smart-http和 ssh 服务器)。

In your case, either your git is too old, or the server is dumb http server (normal http server, without "smart" git support). You need to clone the repository and archive from there.

在您的情况下,要么您的 git 太旧,要么服务器是愚蠢的 http 服务器(普通 http 服务器,没有“智能”git 支持)。您需要从那里克隆存储库和存档。

回答by user4931107

you can't use git achieve with http! only git protocol. i.e.

你不能在 http 中使用 git 实现!只有 git 协议。IE

git archive --format=zip --remote=git://path_to_repository