如何将我的回购附加到heroku应用程序

我创build一个heroku应用程序,然后我的机器崩溃。 我有一台新机器。 如何将我现有的应用程序附加到heroku应用程序。 当我访问heroku页面时,我的应用程序的url是这样的

git@heroku.com:myapp.git 

我不能克隆这个应用程序,因为我已经从github myapp 。 所以我需要添加heroku作为我现有的github应用程序的远程。 任何人都知道的语法。

如果你有heroku工具带:

如果您使用的是Heroku Toolbelt,则更新的语法是

heroku git:remote -a project

看到这更多。

积分: user101289的解决scheme

否则,如果你没有heroku toolbelt:

首先这样做:

 git remote add heroku git@heroku.com:{heroku-app-name}.git 

然后这样做:

 git push heroku master heroku open 

如果您使用的是Heroku Toolbelt,则更新的语法是

heroku git:remote -a project

看到这更多。

如果你只使用Git而不安装Heroku Toolbelt ,你也可以创build一个新的应用程序。

login到您的帐户并转到此链接

https://dashboard.heroku.com/apps

看右上angular的加号,然后select

创build新的应用程序

将应用程序名称留空以让heroku为您select一个。 假设你的heroku应用程序的名字是new-app-xxxxx ,所以为了testing添加一个文件,你可以尝试下面的命令:

 git clone https://git.heroku.com/<new-app-xxxxx>.git cd <new-app-xxxxx> echo "my test file" > test.txt git add . git commit . -m "my test on commit" git push 

在Git提示input用户名时input空(空白),并input密码的API密钥。 您可以通过下面的链接显示您的API密钥。

https://dashboard.heroku.com/account

注意:您无法使用Heroku用户名(电子邮件)和密码对Heroku HTTP Git端点进行身份validation。 使用这里描述的API密钥。