如何防止个人信息在github上的公共回购中显示?

sha*_*aka 1 git ruby-on-rails github

我有一个我用heroku部署的rails应用程序.我也在使用github.在我的应用程序中,我有一个文件(下面),我相信是为了发送邮件所需要的.但是这个文件包含我的个人电子邮件地址,我的github repo是公开的.有没有办法我的网络应用程序仍然可以使用此信息,但没有它出现在我在github上的公共回购中?

ActionMailer::Base.smtp_settings = {
  :address              => "smtp.gmail.com",
  :port                 => 587,
  :domain               => "gmail.com",
  :user_name            => "email",
  :password             => "password",
  :authentication       => "plain",
  :enable_starttls_auto => true
}
Run Code Online (Sandbox Code Playgroud)

Gui*_*ont 5

你不能.推送到Github公共仓库的每个文件都是可读的.据我所知,如果你需要使用Git在heroku上部署配置文件,使用.gitignore将无法解决您的问题.

如果您需要免费的私人存储库,可以尝试Atlassian Bitbucket.