What should be in my .gitignore for an Android Studio project?

后端 未结 30 3914
星月不相逢
星月不相逢 2020-11-22 04:23

What files should be in my .gitignore for an Android Studio project?

I\'ve seen several examples that all include .iml but IntelliJ docs sa

30条回答
  •  佛祖请我去吃肉
    2020-11-22 04:46

    I'm kosher with adding the .iml files and Intellij sez to add the .idea folder but ignore .idea/workspace.xml and .idea/tasks.xml, but what about .idea/libraries/ ?

    I don't see how it makes sense to add this. It has a list of XML files that list libraries the Android Studio project is supposed to know about. These are supposed to come instead from build.gradle defined dependencies -- not an IDE project file.

    Also the contents of one of these files looks like this:

    
        
           
    

    It doesn't make sense to commit this. What if the user specified a different home dir for gradle, or if they use a different gradle version, the path under .gradle/caches/artifacts-xxx is going to be different for them (i.e. artifacts- the number appended on the end will relate to the gradle version release you are using.) These paths are not universal, and yet the advice is to check all this in?

提交回复
热议问题