代码之家  ›  专栏  ›  技术社区  ›  arjun

无法从不同的机器推到Heroku

  •  1
  • arjun  · 技术社区  · 6 年前

    我将repo从Heroku中仪表板设置中提到的URL克隆到Windows机器上。提交更改后,尝试推送到Heroku失败。

    => git push heroku master
    
    fatal: 'heroku' does not appear to be a git repository
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    

    我遵循了一些指示 from here ,现在我得到了

    => git push heroku master
    
    The authenticity of host 'heroku.com (50.19.85.156)' can't be established.
    RSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxx/o.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'heroku.com,xx.xx.xx.xx' (RSA) to the list of known hosts.
    git@heroku.com: Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    
    2 回复  |  直到 6 年前
        1
  •  1
  •   mrzasa    6 年前

    Heroku git使用添加了 heroku keys:add . 您必须为正在处理的每台计算机都有一个单独的私有/公共SSH密钥对。

    添加新密钥 heroku键:添加

    然后验证它是否与 ssh -v git@heroku.com

    https://devcenter.heroku.com/articles/keys#adding-keys-to-heroku

        2
  •  0
  •   Ayush Kanoongo    6 年前

    首先,确保您已登录heroku:

    heroku login
    

    输入您的凭据。

    在新机器上使用克隆的git repo时,通常会出现此错误。即使您的heroku凭据已经在计算机上,克隆的repo和heroku之间仍然没有本地链接。为此,将cd插入克隆repo的根目录并运行

    heroku git:remote -a yourapp
    

    现在它工作得很好,如果您在SSH密钥方面遇到任何错误,应该检查 比特桶 github 公钥。