How to .gitignore app / app.iml in an Android Studio project?

No matter how I structure my .gitignore, I cannot ignore app / app.iml through Android Studio 2.0.0.

So far, I have tried to ignore all * .iml files in the standard Android Studio .gitignore github template, and also directly target the file.

app/app.iml *.iml 

Does anyone encounter a similar problem with this particular file or other * .iml files? How did you resolve it?

+5
source share
4 answers

Try adding a slash to app/app.iml inside your .gitignore how to do it. /app/app.iml . This helped me after consulting @xiaoyaoworm.

+4
source

If the files were already executed before the gitignore update, it will continue to be tracked using git.

Try running git rm --cached app/app.iml and follow this, and then with a different commit, deleting the file.

+12
source

I think what you did should work. Try installing the .ignore plugin, right-click on this app.iml file, "Add to ignore the file" will appear.

+2
source

Try the following steps. 1. Delete the cached iml files, use: git rm --cached 2. Add the * .iml file to the .gitignore file and write it down again.

After this files

iml will not be tracked.

0
source

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


All Articles