How is it that sometimes I can right click and ignore files but sometimes not?
image showing no possibility to perform ignore on the selected file:
Android Studio is just following git rules. gitignore
is for files which are not tracked yet (didn't added to git) , and here you're trying to ignore already tracked file.
In order to stop tracking you should use git rm --cached
, See official docs.
I'm not sure if that's possible using Android Studio git UI.