Instead of creating a new .gitignore file .gitignore you should use the .git/info/exclude file to configure to ignore the rules specific to your repo clone.
So basically go to your project root and run
cd $PROJECT_ROOT echo "*.iml" >> .git/info/exclude
Note that the *.iml template will also take care of files of the form .*.iml , so you can do this with a single ignore rule.
In addition, this complements the existing ignore rules in .gitignore , and the ignore rules .gitignore will apply.
It seems you are already tracking .iml files in your Git repository, so you can try removing them from Git with
git rm -r *.iml git commit -m "removed *.iml"
Please note that this will also eliminate them from the main repository as soon as you click.
Otherwise, you can use git update-index --assume-unchanged <filename> to ignore changes to these files locally. And after that, gitignore rules should work fine.
mu 無
source share