首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在pygit2中进行ssh推送

无法在pygit2中进行ssh推送
EN

Stack Overflow用户
提问于 2014-07-04 01:03:08
回答 1查看 2.5K关注 0票数 1

我正在尝试使用ssh推送到使用pygit2的github存储库。这就是我一直得到的错误。

你能指出错误吗?

代码语言:javascript
复制
>>> sshcred = repo_.pygit2.credentials.Keypair('avckp','id_rsa.pub','id_rsa','')
>>> remo2.credentials=sshcred
##  remo2 is a remote object for the repo
>>> remo2.url
u'https://github.com/avckp/sansa-pygit.git'
>>> remo2.push_url = remo2.url
>>> remo2.push('refs/heads/master')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "pygit2/remote.py", line 301, in push
    check_error(err)
  File "pygit2/errors.py", line 57, in check_error
    raise GitError(message)
GitError: HTTP parser error: the on_headers_complete callback failed
EN

回答 1

Stack Overflow用户

发布于 2014-11-26 11:05:38

正如#428所说,Keypair中的用户名应该是'git‘。

它应该是:

代码语言:javascript
复制
sshcred = repo_.pygit2.credentials.Keypair('git','/path/to/id_rsa.pub','/path/to/id_rsa','')
remo.crendentals = sshcred

然后再次尝试推送。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24559529

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档