【问题标题】:Push to Github Fails under WindowsWindows 下推送到 Github 失败
【发布时间】:2013-02-14 23:59:08
【问题描述】:

我无法从 Windows (DOS) 命令提示符推送到 github,但从 bash 中它可以工作。

如果我运行 git push origin master 我得到:

Permission denied (publickey).
fatal: Could not read from remote repository.

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

如果我运行ssh-add,我得到了:

Could not open a connection to your authentication agent.

在 bash (msysgit) 下一切正常 - 这怎么可能?

【问题讨论】:

    标签: git github ssh


    【解决方案1】:

    解决方案是意识到 ssh(在 windows 下)正在我的 %USEPROFILE%\.ssh 文件夹中查找名为 id_rsa 的文件,但其中的文件名称为 github_rsa

    解决方案:

    rename %USERPROFILE%\.ssh\github_rsa id_rsa
    rename %USERPROFILE%\.ssh\github_rsa.pub id_rsa.pub
    

    嘿,presto,现在无需进入 bash 即可推拉!

    可能的解释:以前安装的 github for windows 生成了 github_rsa 文件。

    奇怪的是,在重命名 git push 之后仍然可以在 bash 下工作!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-02-16
      • 1970-01-01
      • 1970-01-01
      • 2019-08-18
      • 2011-02-11
      • 1970-01-01
      • 2021-11-22
      相关资源
      最近更新 更多