所以我在一個項目上合作,克隆了github的回購,做了一些改變,並推到了heroku。現在克隆的應用程序的所有密鑰和密碼都是硬編碼的,而不是ENV變量。不能推主分支到heroku
所以我創建了ENV變量,將該文件添加到.gitignore。所以這個應用程序在提交歷史中仍然有這些鍵。我現在所做的是讓作者在github上創建一個新的repo,從原始應用程序中刪除.git文件並將新代碼推送到新的repo。
所以現在我已經克隆了新的應用程序,添加了一個新的遠程heroku應用程序。
heroku git:remote -a myapplication
我的問題是我不能推新應用程序到現有的heroku應用程序。當我做我得到
error: failed to push some refs to '[email protected]:myapplication.git
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
所以一個git拉說,一切都是最新的。
遠程Git -v輸出
heroku [email protected]:myapplication.git (fetch)
heroku [email protected]:myapplication.git (push)
origin [email protected]:author/myapplication.git (fetch)
origin [email protected]:author/myapplication.git (push)
我能做些什麼來推動新的應用到現有的Heroku應用程序?
感謝
UPDATE
於是我就
git push -f heroku master
從而拉高,但我有錯誤
you have not declared a Ruby version in your Gemfile.
To set your Ruby version add this line to your Gemfile:"
ruby '1.9.2'"
香港專業教育學院從未有過的指定之前。現在所有的原始配置變量,其中設置不再存儲在heroku
謝謝你的回答,你介意看我的更新,並告知我是否仍然可以做同樣的事情嗎? – Richlewis
@Richlewis我不會將力量直接推向heroku:首先拉動的所有點都是讓推動更容易(沒有任何強制選項)。通過heroku命令推動heroku應該發生,而不是直接通過git。如果你有權訪問heroku服務器,你可以嘗試重置到git repo以前的狀態(如http://stackoverflow.com/a/135614/6309) – VonC
好了,所以我回滾了,應用程序很好,im擔心從heroku拉,因爲它仍然有原始的代碼庫,那裏是一個很多變化的地獄,這將導致重大沖突 – Richlewis