Heroku:帐户无权访问应用 [英] Heroku: account does not have access to app

查看:103
本文介绍了Heroku:帐户无权访问应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图 git pull heroku master ,但我得到了

 !您的帐户email@gmail.com无权访问app_name。 

! SSH密钥指纹:30:02:49:32 ...

致命:无法从远程存储库中读取。

请确保您拥有正确的访问权限
并存在存储库。

我已完成 heroku登录并且已通过身份验证成功。我需要切换帐户,但不知道除了 heroku登录以外还需要执行哪些操作。 -account-someoneelsegmail-com-does-have-access-to-app-name>这里。



对我来说,我有两种不同的Heroku帐户,每个帐户都与不同的git存储库相关联。所以我必须告诉heroku为每一个使用特定的SSH密钥(显然,不只是第一个可用的密钥,这似乎是默认行为)。确切的方法适用于我的步骤此处,然后此处



详细信息:

创建新的rsa密钥:指定任何电子邮件地址想要并选择一个易于记忆并与特定的heroku应用程序相关联的名称。或者您可以将其命名为/ id_rsa_herokualt。

  $ ssh-keygen -t rsa -Cyouremail [at] domain。 com-f〜/ .ssh / id_rsa_myherokuapp 

添加到您的计算机:确保按照刚刚在最后一步中指定的名称输入确切的文件名。

  $ ssh-add〜/ .ssh / id_rsa_myherokuapp 

添加到Heroku:假设您已经登录使用 heroku login

  $ heroku keys:add〜/ .ssh / id_rsa_myherokuapp.pub 



将heroku.com的备用主机添加到您的〜/ .ssh / config。通过转到Finder并按下命令+ shift + g并键入〜/ .ssh /来找到该文件。在文本编辑器中打开配置文件,添加以下文本,然后保存:

 主机heroku-alt 
HostName heroku.com
IdentityFile〜/ .ssh / id_rsa_myherokuapp

更新.git / config使用主机别名。通过访问Finder并按下命令+ shift + g并输入〜/ path / to / your / repository / .git来找到该文件。在文本编辑器中打开配置文件,添加以下文本,然后保存:

  [remoteheroku] 
url = git @ heroku-alt:myherokuapp.git
fetch = + refs / heads / *:refs / remotes / heroku / *

说明:通过在特定项目的.git / config文件的远程中选择heroku和heroku-alt,您可以管理哪些项目使用哪个证书。


I'm trying to git pull heroku master, but I'm getting

 !  Your account email@gmail.com does not have access to app_name.
 !  
 !  SSH Key Fingerprint: 30:02:49:32...

fatal: Could not read from remote repository.

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

I have done heroku login and been authenticated successfully. I need to switch account's but not sure what else I need to do besides heroku login.

解决方案

Try all of the helpful answers found here.

For me, I had two different heroku accounts, each associated with a different git repository. So I had to tell heroku to use specific SSH key for each one (apparently, not just the first available one, which seems to be the default behavior). The exact method that worked for me was following the steps here and then here.

The details:

Create a new rsa key: Specify any email you want and choose a name that will be easy for you to remember and associate with the specific heroku app. Or you could name it something like /id_rsa_herokualt.

$ ssh-keygen -t rsa -C "youremail[at]domain.com" -f  ~/.ssh/id_rsa_myherokuapp

Add to your machine: Make sure to type in the exact file name as you just specified it in the last step.

$ ssh-add ~/.ssh/id_rsa_myherokuapp

Add to Heroku: This assumes you have already logged into heroku using heroku login.

$ heroku keys:add ~/.ssh/id_rsa_myherokuapp.pub

Add an alternate host for heroku.com to your ~/.ssh/config. Locate this file by going to Finder and pressing command + shift + g and typing in ~/.ssh/. Open the Config file in a text editor, add the following text, and then save it:

Host heroku-alt
HostName heroku.com
IdentityFile ~/.ssh/id_rsa_myherokuapp

Update the .git/config in your project to use the host alias. Locate this file by going to Finder and pressing command + shift + g and typing in ~/path/to/your/repository/.git. Open the Config file in a text editor, add the following text, and then save it:

[remote "heroku"]
  url = git@heroku-alt:myherokuapp.git
  fetch = +refs/heads/*:refs/remotes/heroku/*

Explanation: By choosing between heroku and heroku-alt in the remote of the .git/config files of specific projects you can manage which projects use which credentials.

这篇关于Heroku:帐户无权访问应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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