37

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?

bluish
  • 24,718
  • 26
  • 114
  • 174
elirigobeli
  • 1,361
  • 2
  • 14
  • 22
  • 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 Answers3

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)
moictab
  • 939
  • 7
  • 25
JulienC
  • 573
  • 6
  • 10
  • 6
    On 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
  • 3
    The 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
    What about the ".gradle" folder? – android developer Jan 13 '15 at 13:13
  • 1
    You 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
  • how about the `gradlew`? – natsumiyu Aug 09 '16 at 07:10
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.
Lonzak
  • 8,564
  • 5
  • 55
  • 81
bahrep
  • 27,991
  • 12
  • 99
  • 140
  • 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
  • 3
    As 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

Community
  • 1
  • 1
CodyF
  • 4,537
  • 3
  • 22
  • 38