5

I am trying out newrelic on a test app which is deployed to heroku.

I have both remotes origin(the public github repo) and heroku.

After pushing to heroku with the newrelic.yml file included, I would like to be able to push changes back to origin but not include the newrelic.yml file because it contains a license_key.

I tried putting config/newrelic.yml in .gitignore but it still tracks the file and pushes the file to origin. Then I tried deleting the file but can't get a clean "git status".

I tried rm config/newrelic.yml but then even with it in .gitignore the next time I push to heroku it removes the file on heroku causing newrelic monitoring to stop.

I saw other similar issues on SO with answers referring to heroku config vars https://devcenter.heroku.com/articles/config-vars but don't understand how this relates if it does, to removing the config file for github.

Thanks

4

1 回答 1

9

Heroku 从 Github 获取所有文件,每次推送都会用新文件替换所有文件。我不认为你可以做这样的事情。

如果您将文件放在 .gitignore 中,您将无法将其推送到 Heroku。

一个解决方案可能是在 Github 上使用分支,在 master 上保留代码而不使用配置文件,在分支“Heroku”上,添加文件并使用它在 Heroku 上进行推送。

于 2013-09-28T00:37:21.850 回答