【发布时间】:2011-02-02 07:06:48
【问题描述】:
在 Heroku 上与 Rails 一起使用的好 .gitignore 是什么?
*.log
*.sqlite3
还有什么?
【问题讨论】:
标签: ruby-on-rails git heroku
在 Heroku 上与 Rails 一起使用的好 .gitignore 是什么?
*.log
*.sqlite3
还有什么?
【问题讨论】:
标签: ruby-on-rails git heroku
这非常类似于:Rails: exclude anything from version control? 这是我的答案。
DHH 只要posted on Twitter,Rails 3 中就会有一个default .gitignore,其中包括:
db/*.sqlite3
log/*.log
tmp/**/*
这通常是我排除的。有些人还喜欢将 database.yml 文件排除在公共 repo 上并且您不想公开数据库密码时。
【讨论】:
请记住,Heroku 的 slug 编译器使用名为 .slugignore 的文件具有非常相似的功能。此文件语法大致与.gitignore 中的相同。
因此您可以继续照常工作(即:存储 PSD 文件、电子表格和其他常见文件),但在运行时将其删除on Heroku 以减小 slug 的大小(
【讨论】:
.slugignore 文件将在它们上传后将其删除。所以你最终还是会提前上传大文件。
https://github.com/github/gitignore/blob/master/Rails.gitignore
*.rbc capybara-*.html .rspec /log /tmp /db/*.sqlite3 /db/*.sqlite3-journal /public/system /coverage/ /spec/tmp **.orig rerun.txt pickle-email-*.html # TODO Comment out this rule if you are OK with secrets being uploaded to the repo config/initializers/secret_token.rb # Only include if you have production secrets in this file, which is no longer a Rails default # config/secrets.yml # dotenv # TODO Comment out this rule if environment variables can be committed .env ## Environment normalization: /.bundle /vendor/bundle # these should all be checked in to normalize the environment: # Gemfile.lock, .ruby-version, .ruby-gemset # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: .rvmrc # if using bower-rails ignore default bower_components path bower.json files /vendor/assets/bower_components *.bowerrc bower.json # Ignore pow environment settings .powenv # Ignore Byebug command history file. .byebug_history
【讨论】:
在 Heroku 上,最好的开始选择是:
db/
log/
test/
tmp/
【讨论】: