git 当我尝试将最新更改推送到 Heroku 时,为什么我的带有指纹的密钥没有得到授权?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9049905/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why is my key w/ fingerprint not authorized when I try to push latest changes to Heroku?
提问by user1175844
Before you tell me to refer to the similar questions, I've literally tried all of their answers and did my own research online (even though I am new to this). When I try to push the latest changes to Heroku with
在你告诉我参考类似的问题之前,我已经尝试了他们所有的答案,并在网上做了我自己的研究(即使我是新手)。当我尝试将最新更改推送到 Heroku 时
git remote add heroku [email protected]:reviews.git
and then
进而
git push heroku master
I get the following:
我得到以下信息:
Macintosh-84:reviews dk1552$ git push heroku master
! Your key with fingerprint 2c:4e:7b:df:02:7e:18:c8:2a:16:04:bc:59:5b:88:98
is not authorized to access reviews.
fatal: The remote end hung up unexpectedly
I've set up keys, removed them, changed them, etc. All my folders/files are in Users/Dennis/...
我已经设置了密钥,删除了它们,改变了它们等等。我所有的文件夹/文件都在 Users/Dennis/...
One file I am updating for example is located in: Users/Dennis/reviews/app/views/static_pages/about_us.html.haml
例如,我正在更新的一个文件位于: Users/Dennis/reviews/app/views/static_pages/about_us.html.haml
What do I need to do to fix this?
我需要做什么来解决这个问题?
回答by user664833
See https://stackoverflow.com/a/9070685/664833and run ssh-add -d
then try pushing again.
请参阅https://stackoverflow.com/a/9070685/664833并运行ssh-add -d
然后再次尝试推送。
Also try https://stackoverflow.com/a/8803103/664833(create a new key-pair and add upload the public key to Heroku).
还可以尝试https://stackoverflow.com/a/8803103/664833(创建一个新的密钥对并将公钥上传到 Heroku)。
回答by jaketrent
If you have mixed your accounts and run into this problem, an easy workaround is to invite the yourself as a collaborator under your other email to the heroku app.
如果您混合了您的帐户并遇到了这个问题,一个简单的解决方法是在您的其他电子邮件下邀请您自己作为合作者到 heroku 应用程序。
回答by Jon McIntosh
One time this happened to me and I realized that I (having multiple Heroku accounts) used one account to initialize the Git and another to push the changes. Obviously this would create issues with your public key.
有一次这发生在我身上,我意识到我(有多个 Heroku 帐户)使用一个帐户来初始化 Git,而另一个帐户来推送更改。显然,这会给您的公钥带来问题。
If that's the case for you either remove the .git/.gitignore directories and re-initialize with your preferred account, or sign in with the Heroku account that you used to init the Git and push the changes using that one.
如果是这种情况,您可以删除 .git/.gitignore 目录并使用首选帐户重新初始化,或者使用用于初始化 Git 的 Heroku 帐户登录并使用该帐户推送更改。
回答by tukkajukka
I ran into a similar issue when I created another Heroku app in a directory where git already had a working remote to an existing repository in Heroku. I kept getting the exact same error message regarding the fingerprint. So what I was trying to do was to create another environment for my web application.
当我在一个目录中创建另一个 Heroku 应用程序时,我遇到了类似的问题,其中 git 已经有一个工作远程到 Heroku 中的现有存储库。我不断收到有关指纹的完全相同的错误消息。所以我试图做的是为我的 Web 应用程序创建另一个环境。
By issuing these commands I was able to push to the remote again. Note that the keys:add
command gives a list of available public keys. Choose the correct key that is associated with the account you are going to use (that has the application associated to it).
通过发出这些命令,我能够再次推送到遥控器。请注意,该keys:add
命令提供了可用公钥的列表。选择与您要使用的帐户(具有关联的应用程序)关联的正确密钥。
heroku keys:add
- Choose the correct public key from the list for uploading to Heroku.heroku accounts:set <account name>
heroku keys:add
- 从列表中选择正确的公钥以上传到 Heroku。heroku accounts:set <account name>
Now try git push heroku master
again and the problem should be gone.
现在再试git push heroku master
一次,问题应该消失了。
My setup uses the accounts add-on as well. and I've got several Heroku accounts configured on my machine.
我的设置也使用帐户插件。我在我的机器上配置了几个 Heroku 帐户。