railsで使用するgitignoreメモ

まず前提としてgithubが公開しているものをベースにする。


gitignore/Rails.gitignore at master · github/gitignore · GitHub

secret_token.rbとsecrets.ymlについてはどうしようか。
まぁ案件の規模にもよるだろうけど、どちらにしろプライベートな場所に置くと思うのでとりあえずコメントアウトしておく。

# TODO Comment out these rules if you are OK with secrets being uploaded to the repo
# config/initializers/secret_token.rb
# config/secrets.yml

あとはエディタ、OSのゴミなど細かいのを追加。

doc/
*.swp
*~
.project
.DS_Store
.idea
.secret

で最終的にはできたのはこんな感じ。

*.rbc
capybara-*.html
.rspec
/log
/tmp
/db/*.sqlite3
/public/system
/coverage/
/spec/tmp
**.orig
rerun.txt
pickle-email-*.html

# TODO Comment out these rules if you are OK with secrets being uploaded to the repo
# config/initializers/secret_token.rb
# config/secrets.yml

## Environment normalisation:
/.bundle
/vendor/bundle

# these should all be checked in to normalise 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 other unneeded files.
doc/
*.swp
*~
.project
.DS_Store
.idea
.secret

とりあえずこれでやってみる。
なんか不便を感じればその都度改良していこう。