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/whatever
already existed before you added the .gitignore, it'll still be in the repo.
Try a git rm -r tmp && git commit
to remove the whole tmp
directory 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 tmp
should no longer be picked up.
ALso, as @thenetimp points out, your current .gitignore will only ignore /tmp
, but not something/tmp
. I'm not sure if that's your intention or not.
remove the forward slash in front of /tmp/
it should be tmp/
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