Rails: exclude anything from version control?

∥☆過路亽.° 提交于 2019-12-21 05:45:33

问题


When you place a Rails project under version control, do you exclude anything? Log files, for example?


回答1:


DHH just posted on Twitter that there will be a default .gitignore in Rails 3, which includes:

db/*.sqlite3
log/*.log
tmp/**/*

Which is usually what I exclude, some people also like to exclude the database.yml file if it's going on a public repo and you don't want to expose your database passwords.




回答2:


In addition, to what Dan and Sohan suggest, I also ignore any native extensions for gems. It's a bit of a hassle to have to delete the extensions every time you deploy. I find it easier to ignore them and then just run the rake tasks to build them after deploying.

Of course if you can always guarantee that your development and production environments are the same OS then you won't need to do this.




回答3:


From my current project: I am using apache + mod_rails + paperclip + sphinx + sitemap-generator

.DS_Store
log/*.log
log/*.pid
tmp/**/*
assets/**/*
db/sphinx/**/*
config/database.yml
config/staging.sphinx.conf
public/sitemap.xml


来源:https://stackoverflow.com/questions/1969393/rails-exclude-anything-from-version-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!