如何链接一个文件夹与现有的Heroku应用程序与汞 [英] How to link a folder with an existing Heroku app with mercurial
问题描述
我在Bitbucket上有一个现有的Django应用程序,我可以部署到Heroku whith hg-git
。每当我想在我的应用程序文件夹中运行一些heroku命令,我得到以下错误:
I have an existing Django app on Bitbucket and I'm able to deploy to Heroku whith hg-git
. Whenever i want to run some heroku command inside my app folder i get the following errors:
$ heroku ps
! No app specified.
! Run this command from an app folder or specify which app to use with --app <app name>
$ heroku logs
! No app specified.
! Run this command from an app folder or specify which app to use with --app <app name>
etc.
目前的解决方法是指定应用名称: heroku ps --app< app name>
但是我正在寻找一种方法将我的存储库名称链接到远程Heroku应用程序名称,如如何使用git完成。
Current workaround is to specify the app name: heroku ps --app <app name>
but i'm looking for a way to link my repository name to the remote Heroku app name like how it's done using git.
我现在无法将我的应用移动到github。 p>
I'm not in a position to move my app to github for now.
推荐答案
考虑到 heroku
正在查看 .git / config
文件以获取应用程序名称,只需在本地存储库中执行以下操作:
Considering heroku
is looking at the .git/config
file to get the app name, just do the following inside your local repository:
git init
git remote add heroku git@heroku.com:<app-name>.git
为了不弄乱你的存储库,你还会添加以下行到 .hgignore
:
In order not to mess your repository, you'll also add the following lines to .hgignore
:
#Git setup
.git/**
现在,通常的heroku命令不再要求默认的应用程序名称。
Now, usual heroku commands no more ask for the default app name.
这篇关于如何链接一个文件夹与现有的Heroku应用程序与汞的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!