What is a good .gitignore to use with Rails on Heroku?

What is a good .gitignore to use with Rails on Heroku?

*.log  
*.sqlite3

what else?

  • Git branch no tracking information
  • gitolite permissoins with branches and folders
  • git and eclipse
  • Eclipse + Maven + Git + Multi-Module projects = Unhappiness
  • Git - did init bare in wrong directory
  • Git on windows, is it truly distributed?
  • Problem installing MSysGit (libiconv-2.dll is missing…)
  • git-svn - Checkout a remote branch that already exists in svn when my master is already a branch. Explain this .git/config
  • Restore pathogen git repos
  • Convention for storing bare Git repositories in home directory?
  • How to rebase over already rebased branch
  • Visual Studio Team Explorer + VS Online Sync error
  • 5 Solutions collect form web for “What is a good .gitignore to use with Rails on Heroku?”

    This is pretty similar to: Rails: exclude anything from version control? Here is my answer from that.

    DHH just posted on Twitter that there will be a default .gitignore in Rails 3, which includes:

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

    This is usually what I exclude. Some people also like to exclude the database.yml file if it’s going on a public repo and you don’t want to expose your database passwords.

    https://github.com/github/gitignore/blob/master/Rails.gitignore

    *.rbc
    capybara-*.html
    .rspec
    /log
    /tmp
    /db/*.sqlite3
    /db/*.sqlite3-journal
    /public/system
    /coverage/
    /spec/tmp
    **.orig
    rerun.txt
    pickle-email-*.html
    
    # TODO Comment out this rule if you are OK with secrets being uploaded to the repo
    config/initializers/secret_token.rb
    
    # Only include if you have production secrets in this file, which is no longer a Rails default
    # config/secrets.yml
    
    # dotenv
    # TODO Comment out this rule if environment variables can be committed
    .env
    
    ## Environment normalization:
    /.bundle
    /vendor/bundle
    
    # these should all be checked in to normalize 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 pow environment settings
    .powenv
    
    # Ignore Byebug command history file.
    .byebug_history
    

    Keep in mind that Heroku’s slug compiler has a very similar feature using a file named .slugignore. This file syntax is roughly the same as in .gitignore.

    So you can continue working as usual (ie: storing PSD files, spreadsheets and other common files) but remove them at runtime on Heroku to lower the slug’s size (< 20MB sounds good).

    On Heroku, the best starting option is:

    db/
    log/
    test/
    tmp/
    

    There is a project on Github dedicated to storing accurate gitignore files for different languages, editors, etc. While the project does not currently have an entry specific to Heroku, you might still find it useful to review. The project is here and the Rails .gitignore is here.

    FYI, I first found out about this project from this Stack Overflow question.

    Git Baby is a git and github fan, let's start git clone.