Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails which files to ignore for GIT

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?

like image 993
Roger Avatar asked Mar 08 '12 10:03

Roger


People also ask

What files should be ignored in Git?

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 , .

Where should be the Git ignore file?

gitignore is located in the root directory of your repo. / will ignore directories with the name.


2 Answers

Github has sample .gitignore files for almost any kind of project known to humanity.

Check out the repo: https://github.com/github/gitignore

like image 192
Ekin Koc Avatar answered Sep 25 '22 12:09

Ekin Koc


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

like image 36
beanie Avatar answered Sep 25 '22 12:09

beanie