如何设置git远程heroku?

6

当我试图使用命令heroku git:remote -a sleepy-inlet-36834时,在终端中出现了set git remote heroku to https://git.heroku.com/sleepy-inlet-36834.git。然后我尝试像这样设置git远程heroku。

heroku git:remote -a https://git.heroku.com/sleepy-inlet-36834.git.

那时我收到了一个类似这样的错误信息。
 ▸    The requested API endpoint was not found. Are you using the right HTTP
 ▸    verb (i.e. `GET` vs. `POST`), and did you specify your intended version
 ▸    with the `Accept` header?

我该如何解决这个问题?

请帮我回答一下。 - Andrea
2个回答

9

您可以使用Git方式添加远程服务器:

git remote add heroku https://git.heroku.com/sleepy-inlet-36834.git.

您可以运行命令:'git remote rm heroku',然后再试一次,但这也可能意味着您已经设置了git远程。 - Niles Tanner
我在运行了 "git remote rm heroku" 命令后,再次使用 "git push heroku master" 推送代码。但是出现了错误 "! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/sleepy-inlet-36834.git' "。 - Andrea

2
git remote rm heroku     

删除之前的 Heroku。

git remote add heroku https://example-example.git 

将git远程仓库heroku设置为https://example-example.git

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接