Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added default .gitignore (this is just recognizing Git market share, …

…don't throw a hissy if you use another SCM) [DHH]
  • Loading branch information...
commit a642edbef31fe96fad488accf0052653c573e8db 1 parent f095e6f
@dhh dhh authored
View
2  railties/CHANGELOG
@@ -1,5 +1,7 @@
*Edge*
+* Added default .gitignore (this is just recognizing Git market share, don't throw a hissy if you use another SCM) [DHH]
+
* Added cookies.permanent, cookies.signed, and cookies.permanent.signed accessor for common cookie actions [DHH]. Examples:
cookies.permanent[:prefers_open_id] = true
View
1  railties/lib/rails/generators/rails/app/app_generator.rb
@@ -49,6 +49,7 @@ def create_root
def create_root_files
copy_file "README"
+ copy_file "gitignore", ".gitignore"
template "Rakefile"
template "config.ru"
template "Gemfile"
View
3  railties/lib/rails/generators/rails/app/templates/gitignore
@@ -0,0 +1,3 @@
+db/*.sqlite3
+log/*.log
+tmp/**/*

12 comments on commit a642edb

@unimatrixZxero

I'm using a gem for that, called git-rails. But I guess this gives people who don't know the gem a break.

@amasses

This comment is gold!

@cousine

GIT FTW :D:D

@joshsusser

The default gitignore is good. Shouldn't it include database.yml too? Or would that depend on the generator creating database.yml.example instead?

@notlaforge

What about schema.rb? /me ducks

@mikhailov

Don't you think about seed .gitignore with pretty default settings?
.DS_Store
log/.log
tmp/
/
config/database.yml
db/*.sqlite3

@dcrec1

I dont think config/database.yml should be in the .gitignore. Depending of the project, it's ok to version and to share database configurations, as when using sqlite3 for development, for example.

@lackac

Things like .DS_Store, *.swp, and whatnot should go to your personal .gitignore file at ~/.gitignore

@greatseth

Might be nice to take this a step further:

  • only invoke this behavior when requested e.g. you're a Git user
  • add .gitignore files to directories like 'log' which start out empty
@rails

greatseth, market share would dictate that, if anything, the option should be to opt-out, not opt-in. Yeah, probably good idea with something in the empty directories.

@joshsusser

If you're going to put keeper files in empty directories, which is probably a good idea, please name them .gitkeep instead of .gitignore. Overriding the name .gitignore is just confusing, and it's also exactly the opposite of what you want to accomplish.

@notlaforge

I think Rails creates those directories anyway. FileUtils#mkdir_p and what not.

Please sign in to comment.
Something went wrong with that request. Please try again.