I want to ignore some of my files (/config/environments/production.rb , /webrat.log , /config/database.yml ). My gitignore:
/.bundle
/db/*.sqlite3
/doc/
*.rbc
*.sassc
.sass-cache
capybara-*.html
.rspec
/vendor/bundle
/log/*
/tmp/*
/public/system/*
/coverage/
/spec/tmp/*
**.orig
rerun.txt
pickle-email-*.html
/config/environments/production.rb
/config/*.yml
/*.log
But this doesn't work. What's wrong?
What you did is correct. Probably you have already added these files, before making .gitignore.
So Try this
git rm -r --cached . (Note the period at the end.)
git add .
Then check whether the files that you put in ignore is still added to the index. Or you could modify them and check whether they are being tracked.
If those files were already added to the index, you need to remove them first.
git rm --cache /config/environments/production.rb
git rm --cache /webrat.log
git rm --cache /config/database.yml
Then the .gitignore
can work on those files.
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