2012-01-01 102 views
1

因此,我使用Git Bash创建了一个回购,并且它可以工作(在github.com上的本地和远程回购)。 我推送了README文件进行测试,它工作。在我的配置似乎一切都还好:Git推在Git Bash中工作,但不在SmartGit或TortoiseGit中

[core] 
    repositoryformatversion = 0 
    filemode = false 
    bare = false 
    logallrefupdates = true 
    symlinks = false 
    ignorecase = true 
    hideDotFiles = dotGitOnly 
[gui] 
    pruneduringfetch = true 
    encoding = 
[remote "origin"] 
    url = [email protected]:SOME_USERNAME/some-project-name.git 
    fetch = +refs/heads/*:refs/remotes/origin/* 
[branch "master"] 
    remote = origin 
    merge = refs/heads/master 

而且$ ssh -V [email protected]给出:

Hi SOME_USERNAME! You've successfully authenticated, but GitHub does not provide shell access.

而且我能推的文件和一切,而只能通过混帐击。 不过,我已经试过一起工作,它给了我下面的错误:当我手动更改了“原点” URL这个

The remote end hung up unexpectedly

https://[email protected]/SOME_USERNAME/some-project.git

它的工作。所以它不适用于“git @ ...”,但可以使用“https:// ..”。 我试过另一个程序--SmartGit。这也给了我

The remote end hung up unexpectedly

,但是当我尝试做SmartGit这个“变更网址帽子戏法”,为“https:// ...”它给了我下面的错误:

Push: Authentication failed

Authentication failed Setting remote

Setting remote service path not supported by protocol.

我完全失去了所有这些东西。我究竟做错了什么?

+0

你知道TortoiseGit和GitBash是否使用相同的ssh密钥吗? – Douglas 2012-01-01 10:39:38

回答

2

尝试以管理员身份运行SmartGit。

+0

谢谢,它现在可行!我怎么能想到这一点。 – grjj3 2012-01-01 12:31:40

0

事实上,它不与“git @”网址一起使用,但与“https”一起使用,这表明这是与您的SSH密钥设置有关。确保您为TortoiseGit选择了“OpenSSH”选项(而不是PUTTY),并在TortoiseGit的设置页面中确认“远程”部分指向放置密钥的位置。

+0

是的,我选择了OpenSSH。 – grjj3 2012-01-01 12:19:48

1

SSH将寻找钥匙在%HOME%/.ssh,其中(“HOME”)并不总是定义(msysgit将默认,也许TortoiseGit但you can specify your ssh keys定义它,大概不会SmartGit

所以一定要确保HOME设置到%userprofile%,启动SmartGit之前。