Search code examples
ruby-on-railsgitgitignore

Git is not ignoring tmp files


I'm having this annoying issue in a Ruby On Rails application where git keeps committing these tmp/ files. In my .gitignore file, I have tmp/ so I don't understand why they keep showing up...here is my .gitignore file for reference:

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal

# Ignore all logfiles and tempfiles.
/log/*.log
/tmp/

/public/system/*
/vendor/cache/

# OS generated cache files
Thumbs.db
DS_Store

It's just a minor issue that is getting annoying to my team and I on the repo. Thanks for any and all help!


Solution

  • Try removing the files with git rm. Maybe a command like this will work:

    git rm -R tmp
    

    Then make a commit to record that you have removed the files from git, and git will stop trying to track changes to those files.