Git 推送导致致命:协议错误:行长度错误字符:此 [英] Git push results in fatal: protocol error: bad line length character: This

查看:16
本文介绍了Git 推送导致致命:协议错误:行长度错误字符:此的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让 GitLab 在我的服务器上运行(运行 CentOS 6.5).我跟着 gitlab-receipe 到该行,但我只能不让它工作.我能够访问 Web 界面,创建新项目,但推送到主分支返回以下错误:

I am trying to get GitLab working on my server (running CentOS 6.5). I followed the gitlab-receipe to the line, but I just can't get it working. I am able to access the web interface, create new projects but pushing to the master branch returns the following error :

fatal: protocol error: bad line length character: This

我对生产环境做了检查,结果如下:

I have done checks on the production environment, here are the results :

Checking Environment ...

Git configured for git user? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.7.9 ? ... OK (1.8.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
update hook up-to-date? ... yes
update hooks in repos are links: ... 
ASC / Wiki ... repository is empty
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files: 
    /home/git/repositories: OK
    /home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.4.10
Send ping to redis server: PONG
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... no
  Try fixing it:
  Redownload the init script
  For more information see:
  doc/install/installation.md in section "Install Init Script"
  Please fix the error above and rerun the checks.
projects have namespace: ... 
ASC / Wiki ... yes
Projects have satellites? ... 
ASC / Wiki ... can't create, repository is empty
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.3)

Checking GitLab ... Finished

对于初始化脚本错误,收据说

For the init script error, the receipt says

如果您确定已下载,请不要介意该错误最新的

Do not mind about that error if you are sure that you have downloaded the up-to-date

因为我下载了最新的,所以我真的无能为力.

so as I have downloaded the latest one, I can't really do much about it.

过去一周我一直在敲我的头,无法弄清楚为什么会发生这个错误,任何帮助将不胜感激!

I've been banging my head for the past week, and can not figure out why this error is occurring, any help would appreciated!!

推荐答案

如果其他人有这个问题,解决方案是将用户 'git'(或您的用户的任何名称)的登录 shell 更改为 /bin/bash.这可以通过以下命令完成:usermod -s/bin/bash git (链接).更改登录shell的原因是因为git用户的默认shell是/sbin/nologin(或类似的,视环境而定),这会阻止git应用程序以git用户身份登录git 服务器.

If anyone else has this problem, the solution is to change the login shell of the user 'git' (or whatever your user is called) to /bin/bash. This can be done via the command : usermod -s /bin/bash git (Link). The reason for changing the login shell is because the default shell for the git user is /sbin/nologin (or similar, depending on environment), which prevents the git application from logging in as the git user on the git server.

这篇关于Git 推送导致致命:协议错误:行长度错误字符:此的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆