Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitignore not ignoring .rubocop.yml file

Tags:

git

gitignore

I have just added .rubocop.yml file to my project and added it to .gitignore file but when I do git status it appears as modified. I have never added this file to my repository. Why is .gitignore not ignoring this file?

project

app/ config/ .rubocop.yml

.gitignore

.rubocop.yml

Other files are ignored fine, for example, I also tried adding tags file to the root of the project and adding it to .gitignore and it works.

Why is .gitignore not ignoring .rubocop.yml file?

like image 625
jedi Avatar asked Sep 19 '25 15:09

jedi


1 Answers

Commit your project first, then do git rm --cached .rubocop.yml. It shouldn't be included in your repository the next time you commit

like image 117
akmin Avatar answered Sep 22 '25 04:09

akmin