git gitlab 中的奇怪错误:致命:协议错误:行长字符错误:Depl
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28700988/
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
Strange error in gitlab: fatal: protocol error: bad line length character: Depl
提问by Drakmail
On one of my servers, when I'm try to pull/ls-remote fresh-created repo on gitlab, I'm getting these error:
在我的一台服务器上,当我尝试在 gitlab 上 pull/ls-remote 新创建的 repo 时,我收到以下错误:
git ls-remote [email protected]:mas-vem/dinnerdelivery.git
fatal: protocol error: bad line length character: Depl
If I'm trying to ls-remote one of earliest created repositories, all is fine.
如果我试图 ls-remote 最早创建的存储库之一,一切都很好。
When I'm run this command:
当我运行此命令时:
ssh [email protected] git-receive-pack mas-vem/dinnerdelivery.git
I'm getting this error:
我收到此错误:
Deploy key not allowed to push
But I doesn't want to push =/
但我不想推=/
What it could be? Does it is gitlab issue or error on my side?
它可能是什么?这是 gitlab 问题还是我这边的错误?
回答by Drakmail
Found what is was problem: I just forgot to add deploy key to repo =/ After that issue was solved.
发现问题所在:我只是忘记将部署密钥添加到 repo =/ 在该问题解决后。
回答by Angelo Maragna
Just for other users reference:
仅供其他用户参考:
fatal: protocol error: bad line length character: no s
can be a truncated answer for "No such project".
可以是“没有这样的项目”的截断答案。
As in my case, this kind of error can be fixed by adding user (even yourself) to the project in gitlab:
就我而言,可以通过将用户(甚至您自己)添加到 gitlab 中的项目来修复这种错误:
https://gitlab.com/username/your_project/project_members
https://gitlab.com/username/your_project/project_members
also, ensure your public key is set in your user "Profile settings" > SSH Key or in Project > Settings > Deploy Keys
另外,请确保在您的用户“配置文件设置”> SSH 密钥或项目> 设置> 部署密钥中设置您的公钥
回答by Sandeep
To verify that your remote URL is correct use following command:
要验证您的远程 URL 是否正确,请使用以下命令:
git remote -v
Make sure your "origin" remote URL is correct, because if git is unable to connect to remote then you would see these errors.
确保您的“来源”远程 URL 正确,因为如果 git 无法连接到远程,那么您将看到这些错误。
Fix the remote using following command:
使用以下命令修复遥控器:
git remote set-url <your-remote-name> <your-remote-url>
That should fix this issue.
那应该可以解决这个问题。
回答by Cyberience
I would like to add an aditional fix to this problem, if you are part of a Group, and you can pull the project, but get the error when you push, not having write privledges will give you this error! Make sure you are in the Group that owns the project.
我想为这个问题添加一个额外的修复,如果你是一个组的一部分,你可以拉这个项目,但是当你推送时得到错误,没有写入权限会给你这个错误!确保您在拥有该项目的组中。
回答by Joey Dorrani
fatal: protocol error: bad line length character: This
has been discussed here before. It's a common error.
之前已经在这里讨论过。这是一个常见的错误。
I believe one of the main reasons of this happening is because of problems with the Shell access (is the access allowed?) on the server..
我相信发生这种情况的主要原因之一是由于服务器上的 Shell 访问问题(是否允许访问?)。
I would suggest to look at Git push results in fatal: protocol error: bad line length character: This, it can give you an idea on how to tackle the problem.
我建议查看Git push results in fatal: protocol error: bad line length character: This,它可以让您了解如何解决问题。