3

正如我在标题中所说,我可以推到 gerrit,从 gerrit 中拉出,但我不能樱桃采摘。当我问管理员时,他说我拥有挑选樱桃的所有权利,但我得到的错误是:

错误信息

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

当我尝试拉动和变基时

praveen@praveen-vbox:~/work/myapp$ git pull --rebase
remote: Counting objects: 8888, done
remote: Finding sources: 100% (615/615)
remote: Total 615 (delta 416), reused 536 (delta 416)
Receiving objects: 100% (615/615), 267.47 KiB, done.
Resolving deltas: 100% (416/416), completed with 163 local objects.
From gerrit:myapp
   b7b8734..f5a782b  master     -> origin/master
First, rewinding head to replay your work on top of it...
Fast-forwarded master to f5a782b97079491e25638c9a752794e3af0a7543.

当我尝试检查状态时

praveen@praveen-vbox:~/work/myapp$ git status
# On branch master
nothing to commit (working directory clean)

当我尝试提交时

praveen@praveen-vbox:~/work/myapp$ git commit
[master 4c41a43] Minor fixes
 2 files changed, 2 insertions(+), 2 deletions(-)

当我尝试推送时

praveen@praveen-vbox:~/work/myapp$ git push gerrit:myapp HEAD:refs/for/master
Counting objects: 20, done.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 896 bytes, done.
Total 10 (delta 9), reused 0 (delta 0)
remote: Resolving deltas: 100% (9/9)
remote: Processing changes: updated: 1, done
To gerrit:myapp
 * [new branch]      HEAD -> refs/for/master

当我尝试樱桃采摘

praveen@praveen-vbox:~/work/myapp$ git fetch ssh://praveen@my.appdomain.com:29418/myapp refs/changes/24/5324/2 && git cherry-pick FETCH_HEAD
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

概括

我的应用程序在VirtualBox实例上的Ubuntu 12.04上运行。我所有的同龄人都能够,而且我发现问题只出在我的机器上,而且by也是如此。可能是什么问题?你们有什么建议?除了这些,你还需要什么信息?cherry-pickcherry-pickFETCH


更新#1

配置

praveen@praveen-vbox:~/work/myapp$ git config --list
alias.s=status
alias.c=commit
alias.ca=commit --amend
alias.co=checkout
alias.dc=diff --color
alias.l=log --oneline
alias.pr=pull --rebase
alias.aa=add .
user.email=[removed] /* Removed before posting to SO. Email matches. */
core.editor=vim
color.ui=always
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=gerrit:myapp.git
branch.master.remote=origin
branch.master.merge=refs/heads/master

对于Titas的查询,结果是:

praveen@praveen-vbox:~/work/myapp$ git fetch gerrit refs/changes/96/5396/3
fatal: 'gerrit' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

另外,当我正常执行时,结果如下:

praveen@praveen-vbox:~/work/myapp$ git fetch ssh://praveen@my.appdomain.com:29418/myapp refs/changes/96/5396/3 && git cherry-pick FETCH_HEAD
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

更新 #2:SSH 配置

根据RasmusØstergaardKjærVoss的要求,我已将 SSH 配置文件包含在下面。让我知道是否有什么要改变的。

praveen@praveen-vbox:~/work/myapp$ cat ~/.ssh/config
Host gerrit
HostName my.appdomain.com
Port 29418
User praveen
IdentityFile ~/.ssh/praveen_private
4

3 回答 3

1

,据~/.ssh/我了解git fetch ssh://praveen@my.appdomain.com:29418/将使用id_rsa密钥而不是~/.ssh/praveen_private.

备份你的~/.ssh文件夹然后尝试创建一个~/.ssh/praveen_private名为的副本~/.ssh/id_rsa如果它是一个rsa密钥,否则将它复制到~/.ssh/id_dsa

干杯

于 2012-11-27T00:30:26.873 回答
0

您在 git 或 gerrit 中的设置或 gerrit 部署的整体设置有问题。您可以运行 a git pull,它基本上git fetch && git merge在幕后运行。但是您无法运行git fetch从 gerrit 复制粘贴的命令。查看输出git remote -v并将其与git fetch您尝试运行的cherry-pick 命令的部分进行比较。你打的是完全相同的服务器 URL 和端口吗?作为同一个用户?

最后,作为 Gerrit 的连接测试,尝试运行类似ssh username@gerrit_host -p 29418 gerrit ls-projects. 这应该会返回 Gerrit 服务器上的项目列表,并且是解决任何设置问题的好方法。

于 2012-11-26T20:22:05.297 回答
0

这给了我同样的错误:

ssh firstname.lastname@my.appdomain.com

更改为:

ssh firstname.lastname@gerrit.appdomain.co

为我解决了这个问题。

于 2014-12-24T08:14:44.420 回答