2015-04-29 25 views
3

設置:的Heroku:施藥後叉Git的錯誤

我有一個Node.js的(MEAN fullstack)部署在Heroku上的應用程序(即對myApp)是工作正常。我部署與標準的混帳推

$ git push heroku master 

我想創建應用程序的分期副本,使用Heroku的叉這樣做(按https://devcenter.heroku.com/articles/fork-app)。

$ heroku fork -a myApp myApp-staging 

臨時應用程序也能正常工作與它自己的數據庫,有它自己的一套配置變量(ES預期)。 !重要

我還創建了一個新的遠程Git

$ git remote add staging [email protected]:myApp-staging.git 
// repo address taken from "heroku info -a myApp-staging" 

問題:

1)如果我嘗試推到生產即。 「git push heroku master」它 工作正常。

2)如果我試圖推分期

$ git push staging master 

我得到 「權限被拒絕(公鑰)」。
3)如果我嘗試我的臨時應用程序的git回購複製到另一個目錄中我得到一個空的回購

$ heroku git:clone -a industryhub-staging 
// warning: You appear to have cloned an empty repository 

哪裏是我的分期回購? Heroku在我的登臺實例上運行哪些代碼?最後 - 我如何推動分期?

回答

4

想通了。這裏是爲了後人。

錯誤是錯誤的遠程爲登臺應用程序。我

$ git remote add staging [email protected]:myApp-staging.git 

創造了它,我不得不

$ git remote -v 
heroku https://git.heroku.com/myApp.git (fetch) 
heroku https://git.heroku.com/myApp.git (push) 
staging [email protected]:myApp-staging.git (fetch) // wrong 
staging [email protected]:myApp-staging.git (push) // wrong 

我應該做的

$ git remote add staging https://git.heroku.com/myApp-staging.git // over https 

現在我的git顯示

$ git remote -v 
heroku https://git.heroku.com/myApp.git (fetch) 
heroku https://git.heroku.com/myApp.git (push) 
staging https://git.heroku.com/myApp-staging.git (fetch) // OK 
staging https://git.heroku.com/myApp-staging.git (push) // OK 

,生命又是桃色的!


注:Heroku的說,新的回購協議分叉的應用後空。 https://devcenter.heroku.com/articles/fork-app#forked-app-state