In Eclipse, I had the custom of adding bin and gen directories to SVN ignore. But now, using Android Studio (based on IntelliJ IDEA), which files should I ignore?
Asked
Active
Viewed 3.5k times
37
-
See http://stackoverflow.com/questions/16736856/what-should-be-in-my-gitignore-for-an-android-studio-project – mjn Aug 11 '14 at 09:03
-
Does this answer your question? [What should be in my .gitignore for an Android Studio project?](https://stackoverflow.com/questions/16736856/what-should-be-in-my-gitignore-for-an-android-studio-project) – bluish Nov 29 '19 at 14:30
3 Answers
34
I added the following items in my .gitignore
, it should be the same for SVN:
- gradle
- .idea
- *.iml
- build
- .DS_Store (for mac only)
-
6On the docs it's said that do should put *.iml files to version-control: http://devnet.jetbrains.com/docs/DOC-1186 Why do you ignore them? – bahrep Jun 07 '13 at 11:45
-
Thanks, I also added the lines on this [link](http://th4t.net/android-studio-gitignore.html) – elirigobeli Jun 11 '13 at 17:43
-
3The docs also say to include `"All the files under .idea directory in the project root except the workspace.xml and tasks.xml files which store user specific settings"` https://intellij-support.jetbrains.com/entries/23393067 – Steven Anderson Jun 10 '14 at 23:34
-
8
-
1You can also ignore the "local.properties" file, since it is just an auto generated file that points to the android-sdk directory on your computer. – CodyF Mar 02 '16 at 16:25
-
-
The .idea folder includes the ".gitignore" file, should we just ignore the whole folder? – Pavlos Mavris Apr 25 '23 at 08:33
18
See this IntelliJ IDEA KB article: "How to manage projects under Version Control Systems".
Add to Subversion:
- all files under
/.idea
directory in the project root but ignore workspace.xml and tasks.xml, - all .iml module files.
-
This seems to be the correct answer. The files under .idea should be included and also the .iml files. – zreptil Sep 23 '15 at 07:44
-
3As replied by "Serge Baranov" on same thread, it would depend on the project you are using. If the project is Maven or Gradle based and these library files are generated automatically on import, you can exclude them from the version control. When the libraries are configured manually by the user, they should be shared. – Sachchidanand Nov 17 '15 at 13:10
11
I've used the following SVN ignore list sucessfully:
.gradle
local.properties
.idea/workspace.xml
.idea/libraries
.DS_Store
build
The ignore should be applied recursively.
Reference: Same question, for git