首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过ssh-config访问git存储库

通过ssh-config访问git存储库
EN

Unix & Linux用户
提问于 2017-03-27 10:37:17
回答 1查看 2.1K关注 0票数 3

我正试图从cygwin推进到我的git存储库,但没有成功。以前很管用的。我得到了

代码语言:javascript
复制
$ git push
ssh: Could not resolve hostname prooftheory: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

现在,我的ssh-config文件对我来说是可读的。

代码语言:javascript
复制
-rwxrwxr--+ 1 user Tartományfelhasználók 230 Dec 10  2015 /cygdrive/c/Users/user/.ssh/config

它包含了

代码语言:javascript
复制
Host phd
    HostName bitbucket.org
    IdentityFile ~/.ssh/id_rsa
    IdentitiesOnly yes
    User git

Host prooftheory
    HostName bitbucket.org
    IdentityFile ~/.ssh/pt_rsa
    IdentitiesOnly yes
    User git

. .git/config除其他外,包含:

代码语言:javascript
复制
[remote "origin"]    
        url = ssh://git@prooftheory/gergely_/prooftheory.git
        fetch = +refs/heads/*:refs/remotes/origin/*

我可以平bitbucket.org。。我在这里错过了什么?

编辑

https://serverfault.com/questions/518729/cygwin-ssh-issue-could-not-resolve-hostname-awshost1-hostname-nor-servname-pro

说cygwin可能从其他地方获得ssh配置信息,但不清楚如何配置git来使用~/.ssh/config。我将该配置复制到~/.ssh/ssh_config,但这没有帮助。不幸的是,ssh -vvv不编写它读取的配置文件。

EN

回答 1

Unix & Linux用户

发布于 2017-03-27 11:41:38

首先,我得做一个符号连接

代码语言:javascript
复制
/home/user

代码语言:javascript
复制
/cygdrive/c/Users/user

然后,如下

https://serverfault.com/questions/253313/ssh-hostname-returns-bad-owner-or-permissions-on-ssh-config

做,做

代码语言:javascript
复制
chmod 600 ~/.ssh/config

它让它发挥作用。

我还是能

代码语言:javascript
复制
key_load_public: invalid format

错误,但尽管如此,它现在起作用了。

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

https://unix.stackexchange.com/questions/354086

复制
相关文章

相似问题

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