开发者

Which parts of a Ruby on Rails project should be checked into the repository?

I am setting up a new source control repository for a Ruby on Rails project. I am using Mercurial and I am wondering which part of my local directory to check in.

The way I have it set up locally in the project workspace is the following file structure:

drwxr-xr-x 7 agenadinik agenadinik 4096 2011-04-27 09:58 app
drwxr-xr-x 5 agenadinik agenadinik 4096 2011-04-27 09:58 config
-rw-r--r-- 1 agenadinik agenadinik  154 2011-04-27 09:58 config.ru
drwxr-xr-x 3 agenadinik agenadinik 4096 2011-04-29 14:12 db
drwxr-xr-x 2 agenadinik agenadinik 4096 2011-04-27 09:58 doc
-rwxrwxrwx 1 agenadinik agenadinik  781 2011-05-05 18:57 Gemfile
-rw-r--r-- 1 agenadinik agenadinik 1745 2011-05-05 18:57 Gemfile.lock
drwxr-xr-x 3 agenadinik agenadinik 4096 2011-04-27 09:58 lib
drwxr-xr-x 2 agenadinik agenadinik 4096 2011-04-27 09:58 log
drwxr-xr-x 3 agenadinik agenadinik 4096 2011-05-02 17:16 mysql2
dr开发者_JAVA技巧wxr-xr-x 5 agenadinik agenadinik 4096 2011-04-29 13:17 public
-rw-r--r-- 1 agenadinik agenadinik  264 2011-04-27 09:58 Rakefile
-rw-r--r-- 1 agenadinik agenadinik 9126 2011-04-27 09:58 README
drwxr-xr-x 2 agenadinik agenadinik 4096 2011-04-27 09:58 script
drwxr-xr-x 7 agenadinik agenadinik 4096 2011-04-27 09:58 test
drwxr-xr-x 6 agenadinik agenadinik 4096 2011-04-27 09:58 tmp
drwxr-xr-x 3 agenadinik agenadinik 4096 2011-04-27 09:58 vendor

Thanks, Alex


Gemfile.lock MUST be checked in!

Ignore

  • tmp/
  • db/*.sqlite
  • public/system/*
  • log/*


I believe you should ignore

  • tmp/.
  • db/*.sqlite
  • public/assets(system etc - attaches)
  • log/*

EDIT

@normalocity wrote:
Any any file that contains sensitive information (especially if the code repository is in a public place, such as Git). For example, I have an app that stores my SMTP server password in a file so my app can send email. The file that contains that password is NOT included in my repository, however. I secure-copy it by hand if there are changes to the file (which are extremely rare, and obvious when my test suite fails, in my case). – normalocity


This is a good guide: http://railscasts.com/episodes/36-subversion-on-rails

You basically want to ignore these files:

  • log/*
  • tmp/*
  • config/database.yml


Rails 3 projects defaults to ignore these files (for Git, but it should be the same for any VCS):

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

I would recommend that you DO keep your Gemfile.lock in your repository. If anyone else is working on the same project, it will guarantee that everyone is working with the exact same versions of each gem. See more here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜