I created a GIT repo, locally. I now see a bunch of files i rather ignore for GIT check-in. This brings me to the question: is there any default .gitignore for Rails? Any best practices?
I think of tmp and log for sure. But are there any other files or folders i should consider?
Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are: dependency caches, such as the contents of /node_modules or /packages. compiled code, such as .o , .
gitignore is located in the root directory of your repo. / will ignore directories with the name.
Github has sample .gitignore
files for almost any kind of project known to humanity.
Check out the repo: https://github.com/github/gitignore
this is a gitignore from a relatively large Rails 3.2 app (created with Rails 3.1)
/.bundle /db/*.sqlite3 /log/*.log /tmp config/database.yml config/google_analytics.yml .DS_Store /nbproject/ public/assets/**
just the basic gitignore which comes with rails and added some developer specific stuff like Netbeans project stuff, the .DS_Store from OS X
and we don't like passwords in our repository, so we add all yml files with passwords to gitignore
we also added public/assets/** since we deploy our apps with capistrano and generate the assets during the deploy and push them to amazon
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With