How do I get git to ignore my csv files?

I want git to ignore my csv files. But, when I do git status , I see that csv is in "Changes not staged for commit" . But, I swear, I added it to the .gitignore file a while ago. In fact, when I look at the .gitignore file, I see that it is!

 *.csv 

So how do I get git to ignore my csv? The problem is that I want to be able to do git reset and git checkout without worrying about rewritable csv in my working directory.

+5
source share
1 answer

It seems that the problem is that csv files are already tracked in commit earlier, so even if you add *.csv , git will start tracking previously tracked files.

You can solve this problem using the git rm --cached option discussed in detail by fooobar.com/questions/405 / ...

+3
source

Source: https://habr.com/ru/post/1233883/


All Articles