python - 致命:协议错误:错误的行长度字符:Pa
问题描述
我最近一直在PyCharm中使用 Git 。
但是当我测试 Git URL 时,它给了我这个错误:
fatal: protocol error: bad line length character: Pa
通过专用帐户访问内部服务器上的远程存储库:
anAccount@ourServer:ourRepo
解决方案
首先检查切换协议是否有帮助:
- 如果 Git URL 是
https://github.com/...
,则切换到ssh://git@github.com/...
- 如果 Git URL 是
git@github.com:...
,则切换到https://github.com/...
对于 SSH URL,至少尝试:
- 生成用于测试的PEM ssh 密钥,无需密码
- 在其中注册公钥
yourUser@yourRemoteServer:~/.ssh/authorized_keys
(确保将公钥内容复制id_rsa.pub
为该文件中的一行authorized_keys
) - 确保使用 OpenSSH,而不是
Plink.exe
那是:
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\cmd;%GH%\mingw64\bin;%PATH%
ssh-keygen -m PEM -t rsa -P ""
# Copy the %USERPROFILE%\.ssh\id_rsa.pub content to the remote server
推荐阅读
- javascript - 使用 php 变量在 innerElement Javascript 中添加表单
- python - 使用 skimage regionprops 过滤区域并使用过滤后的组件创建蒙版
- terraform - 使用内部条件解析 Terraform 文件
- google-cloud-bigtable - BigTable:有没有更好的方法从部分行键中获取唯一值?
- android - android setRepeatingAlarm 没有被取消
- python - 如何从 python 客户端指定 Twilio Whatsapp 模板?
- javascript - 定位和更改锚元素测试和使用原生 JavaScript 嵌套的属性
- r - 如何在R中更改多个数据框的数据类型
- python - 在一个数据框中绘制 Python 中的多行(每个类别一行)
- javascript - 当我输入四位数字时,会添加“/”,但是当我模糊时,“/”会消失