2012-04-06 68 views
4

我有一個現有的Django應用程序在Bitbucket上,我可以deploy to Heroku whith hg-git。每當我想我的應用程序文件夾中運行一些命令的Heroku我得到以下錯誤:如何鏈接一個文件夾與現有的Heroku應用程序與mercurial

$ 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應用程序名稱,如how it's done using git

我現在無法將應用程序移動到github。

回答

4

考慮heroku正在看.git/config文件,以獲取應用程序的名稱,只是你的本地倉庫裏以下:

git init 
git remote add heroku [email protected]:<app-name>.git 

爲了不弄亂你的倉庫,你還可以添加以下幾行到.hgignore

#Git setup 
.git/** 

現在,通常Heroku的命令沒有更多要求的默認應用程序名稱。

+0

注意:如果您使用Git(不是這個問題,我知道,但我來這裏),你應該使用這個命令:「heroku git:remote -a app」 – dfrankow 2015-07-26 17:52:47

6

我建議試試Hg-Git的「intree」配置選項。設置,通過添加以下到您的hgrc:

[git] 
intree = True 

有了那一套,用汞的Git內部使用Git倉庫將被存儲爲工作副本內的「git的」目錄,而不是嵌套在「.hg」目錄。

Heroku會看到這個存儲庫的配置。按照其他答案(下面引用)中的建議添加遙控器,並且應該全部設置好。

git remote add heroku [email protected]:<app-name>.git 

就目前而言,我發現汞的Git配置選項最好的文檔是項目的到位桶頁面上顯示的自述:https://bitbucket.org/durin42/hg-git

相關問題