无法让git扩展将某些东西推送到github SSH问题 [英] Cannot get git extensions to push something to github SSH problems

查看:223
本文介绍了无法让git扩展将某些东西推送到github SSH问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用git扩展,到目前为止我非常喜欢它,但我没有设法推送到github。以下命令在git bash中正常工作:

  git pushoriginmaster:master 

然后当我使用git扩展时,我得到这个:

  C:\ Program Files \Git\bin\git.exe推送originmaster:master 
权限被拒绝(publickey)。
致命:远端意外挂断

完成

在git设置中,它只是选择了openSSH,我想保留它,因为putty看起来更麻烦。

我已经在gitextensions中添加了远程地址,实际上我只是为了测试而从bash中完成的唯一的事情就是上面的命令并为SSH密钥设置了通配符。其他的都在git扩展中设置。所以我想一切都必须正确设置。例如,电子邮件地址和名称是正确的...

  ssh git@github.com 

也可以很好地连接到bash



编辑

因此,我可以通过将git-extensions中的命令放在cmd中来重现错误。显然,从git bash和cmd运行有区别,git-extensions像windows命令一样运行这个命令......任何线索?

update
如果我从git-extensions的菜单中选择git-bash,我会得到一个完全是的窗口,就像我在资源管理器的右键单击我的repo文件夹并选择git bash在这里。现在,在从资源管理器中打开的那个中,我可以推送,并且在从扩展中打开的那个中,我得到了公钥问题。 解决方案

好的,我解决了它。



我使用浏览器外壳扩展从git扩展和git bash中打开了git bash。然后我用ssh -vvv git@github.com从两个地方查看了差异。

事实证明,因为我改变了git配置文件的位置(我倾向于以便立即重新格式化,所以c:\文档和设置...对于存储任何我可能想要保留的东西来说都是非常糟糕的),当从git扩展运行时,git也在寻找不同位置的ssh密钥。所以我添加了我的git cofig文件所在的.ssh文件夹,现在它工作正常。我认为git-extensions会将git的HOME变量设置为配置文件的路径。



现在,这并不明显......


Im trying to use git extensions and I really like it so far, but I don't manage to push to github. The following command works fine in git bash:

git push "origin" master:master

and then when I push with git extensions I get this:

C:\Program Files\Git\bin\git.exe push "origin" master:master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Done

In the git settings it just has openSSH selected which I would like to keep because putty seems more hassle.

The remote addres I have added in gitextensions, actually the only thing I have done from the bash just to test is the command above and gerenating the SSH keys. All else is set up in git extensions. So I suppose everything must be set up correctly. Eg, the email adress and name are correct...

ssh git@github.com

also connects fine, from bash

edit:

So I can reproduce the error by putting the command from git-extensions in cmd. Appearantly there is a difference between running from git bash and from cmd and git-extensions runs this command like a windows command... any clues?

update: If I choose git-bash from the menu in git-extensions I get a window that is exactly the same as when I right click in explorer on my repo folder and choose git bash here. Now, in the one opened from explorer I can push and in the one opened from extensions I get the public key problem.

解决方案

Ok, I solved it.

I opened the git bash from git extensions and a git bash using the explorer shell extensions. I then ran ssh -vvv git@github.com from both to see the difference.

It turned out that because I changed the location of the git config file ( I tend to reformat every now and then, so c:\documents and settings... is notoriously bad for storing anything I might want to keep persistent), when run from git extensions git was also looking for the ssh keys in a different location. So I added the .ssh folder where my git cofig file is and now it works fine. I think git-extensions sets the HOME variable for git to whatever you set as path for the config file.

Now, that was not obvious...

这篇关于无法让git扩展将某些东西推送到github SSH问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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