Git 如何设置heroku toolbelt以使用-r<;昵称>;指定应用程序的步骤
在我的旧机器上我可以打字Git 如何设置heroku toolbelt以使用-r<;昵称>;指定应用程序的步骤,git,heroku,Git,Heroku,在我的旧机器上我可以打字 heroku config -r prod 查看昵称为“prod”(而不是--app-actual\u-app\u-name)的应用程序的配置设置 在我的新机器上,使用同一版本的heroku toolbelt,我记不起如何告诉heroku toolbet接受-r prodn,而不是-app-actual\u app\u name 这两台机器上的git配置文件似乎是相同的,因此它不是git confgi设置…2014年12月更新 向Heroku宣布“: HTTP Git
heroku config -r prod
查看昵称为“prod”(而不是--app-actual\u-app\u-name)的应用程序的配置设置
在我的新机器上,使用同一版本的heroku toolbelt,我记不起如何告诉heroku toolbet接受-r prodn
,而不是-app-actual\u app\u name
这两台机器上的git配置文件似乎是相同的,因此它不是git confgi设置…2014年12月更新
向Heroku宣布“:
HTTP Git现在是默认值,heroku-create
、heroku-Git:remote
和heroku-Git:clone
命令都会将本地环境配置为使用HTTP Git。如果出于任何原因,您想在特定应用程序中使用SSH Git,只需向这些命令传递一个
--SSH Git
标志,例如:
如果希望在特定计算机上始终将SSH Git与Heroku一起使用,可以添加以下全局配置:
HTTP URL仍将写入.git
文件夹,但git将动态重写所有Heroku HTTP git URL以使用SSH。有关详细信息,包括如何删除此设置的说明,请参见
原始答复(2014年11月) 第“”条提到: 使用Heroku Toolbelt,您可以通过Git Remote而不是名称来识别应用程序 这意味着-r后面跟着一个远程设备的名称,一个由
git remote-v
返回
因此,请检查您的本地远程git-remote-v
,并尝试使用该名称(参考推送heroku应用程序的远程repo)
请注意:
创建Heroku app repo并添加Git staging remote
在这里,项目与两个Heroku应用程序关联,一个用于登台,另一个用于生产。推git时,请指定正确的远程,使用heroku命令时,请使用
--remote-remote-name
或-r remote-name
选项指定部署应指向的应用程序
要告诉heroku命令将此项目默认为暂存
对于我来说,heroku的新HTTP git部署不起作用,但是您可以使用
git config--global url默认使用旧的ssh。ssh://git@heroku.com/。而不是https://git.heroku.com/
。请看这里@androv,这是一个很好的观点。我在答案中包含了新Heroku政策的一个更完整的摘录,以提高可见性。
$ heroku create --ssh-git
git config --global url.ssh://git@heroku.com/.insteadOf https://git.heroku.com/
heroku login # if you haven't already
heroku create --remote staging # within project dir
heroku create --remote production
git remote -v # expect: origin, staging, production
git config heroku.remote staging