Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么`git clone--depth=1<;url>;`使用HTTP 500的某些存储库失败?_Git - Fatal编程技术网

为什么`git clone--depth=1<;url>;`使用HTTP 500的某些存储库失败?

为什么`git clone--depth=1<;url>;`使用HTTP 500的某些存储库失败?,git,Git,我正在使用本地部署的Stash作为Git服务器 克隆某些存储库时,如https://stash.mydomain.net/scm/~be2274/chef repo.git,如果我在没有--depth=1的情况下进行克隆,则一切正常,否则将失败: git clone不带--depth=1: $ git clone -v --bare 'https://stash.mydomain.net/scm/~be2274/chef-repo.git' Cloning into bare repositor

我正在使用本地部署的Stash作为Git服务器

克隆某些存储库时,如
https://stash.mydomain.net/scm/~be2274/chef repo.git
,如果我在没有
--depth=1
的情况下进行克隆,则一切正常,否则将失败:

git clone
不带
--depth=1

$ git clone -v --bare 'https://stash.mydomain.net/scm/~be2274/chef-repo.git'
Cloning into bare repository 'chef-repo.git'...
POST git-upload-pack (gzip 1765 to 943 bytes)
remote: warning: unable to find all commit-graph files
remote: Enumerating objects: 434, done.
remote: Counting objects: 100% (434/434), done.
remote: Compressing objects: 100% (433/433), done.
remote: Total 14489 (delta 310), reused 0 (delta 0)
Receiving objects: 100% (14489/14489), 1.90 MiB | 646.00 KiB/s, done.
Resolving deltas: 100% (9806/9806), done.
$ git clone -v --bare --depth=1 'https://stash.mydomain.net/scm/~be2274/chef-repo.git'
Cloning into bare repository 'chef-repo.git'...
POST git-upload-pack (180 bytes)
error: RPC failed; HTTP 500 curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
git clone
带有
--depth=1

$ git clone -v --bare 'https://stash.mydomain.net/scm/~be2274/chef-repo.git'
Cloning into bare repository 'chef-repo.git'...
POST git-upload-pack (gzip 1765 to 943 bytes)
remote: warning: unable to find all commit-graph files
remote: Enumerating objects: 434, done.
remote: Counting objects: 100% (434/434), done.
remote: Compressing objects: 100% (433/433), done.
remote: Total 14489 (delta 310), reused 0 (delta 0)
Receiving objects: 100% (14489/14489), 1.90 MiB | 646.00 KiB/s, done.
Resolving deltas: 100% (9806/9806), done.
$ git clone -v --bare --depth=1 'https://stash.mydomain.net/scm/~be2274/chef-repo.git'
Cloning into bare repository 'chef-repo.git'...
POST git-upload-pack (180 bytes)
error: RPC failed; HTTP 500 curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
--depth=1
被作为
Git clone
的一个选项提供以仅克隆最近的提交时,为什么Git会失败?我不知道为什么会发生这种情况,错误消息也没有提供真实的信息


什么情况会使git clone--depth=1因HTTP 500而失败?

500错误被定义为内部服务器错误,这意味着服务器遇到一些问题,无法正确完成请求。这是一个服务器端问题,因此,您需要查看服务器日志以找出问题所在。公开披露内部故障信息被认为是一种安全风险,因此如果不访问服务器,您可能无法发现任何信息

因为这是一个服务器端问题,所以您无法在客户端解决它,也无法在客户端解决它。您可以通过选择不以触发Git的方式调用Git来解决这个问题,但是缺陷在服务器上,需要在那里修复。如果您在客户端执行的操作有问题,您将收到400系列错误,而不是500系列错误


如果您无法控制服务器,则应将问题报告给控制服务器的人员,以便他们采取适当的措施解决问题。

检查服务器端日志;查看那里的Git是否因为某种原因提前终止,如果是,原因是什么。@torek-我没有访问这些内容的权限:(你知道另一端的Git请求服务器是什么吗(gitlab、gitolite、gitea、普通Git http后端…)?及其版本?HTTP状态代码500表示服务器出现内部错误,您可以向服务器提供商报告此问题,让他们检查后台发生的情况。