Why there is not ignore option after first commit ?

Answered

After first commit, in Local Changes pane, when I right click on files, there is no "add to gitignore" option 

0
5 comments

Hello Mahmut716

Could you please provide steps to reproduce? 
Are you trying to add to gitignore a file that has already been committed?

0

After first commit, when I try to commit second time, on Local Changes pane, right click on file and there is no "add to gitignore" option.

 

But this opiton exist when you committed first time.

0

Mahmut716 You cannot add to .gitgnore already committed file. If you want to add file to .gitignore after that's already committed please run:
git rm --cached filename

And then add to .gitgnore.

0

Why ? Is this not a bug or a feature to add ? For example, I add pdf or xml file to project for testing after first commit, do I need to clear cache after every .gitignore commit ?

0

Mahmut716
It is not possible to ignore files that are tracked by git. Git supports only ignoring unversioned files.

Please see and vote:
https://youtrack.jetbrains.com/issue/IDEA-21006

0

Please sign in to leave a comment.