I’m having some deployment problems, due to Rails’ tmp/cache/assets folder and git not ignoring tmp/* or tmp/. My entire .gitignore is:
*.rbc
*.sassc
.sass-cache
capybara-*.html
.rspec
/.bundle
/vendor/bundle
/log/*
/tmp/*
/db/*.sqlite3
/public/system/*
/coverage/
/spec/tmp/*
**.orig
rerun.txt
pickle-email-*.html
It’s taken from GitHub gitignore repo. What can I do to fix it? I get tons of errors due to local changes (in the tmp/ folder) on my server, such as error: Your local changes to 'tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705' would be overwritten by merge. Aborting., so I can’t deploy on my dev machine 🙁
Did you add the .gitignore after starting the project? If
tmp/cache/assets/whateveralready existed before you added the .gitignore, it’ll still be in the repo.Try a
git rm -r tmp && git committo remove the wholetmpdirectory from the repo.Try deploying at this point to see if deployment works from a known-good state. If it still doesn’t work, you know there is some other issue.
If everything works, new changes to
tmpshould no longer be picked up.ALso, as @thenetimp points out, your current .gitignore will only ignore
/tmp, but notsomething/tmp. I’m not sure if that’s your intention or not.