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

后端 未结 30 3901
星月不相逢
星月不相逢 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:52

    My advise would be also to not ignore the .idea folder.

    I've imported a Git-based Eclipse project to Android Studio and that went fine. Later, I wanted to import this project with Git (like the first time) to another machine with Android Studio, but that didn't worked. Android Studio did load all the files but wasn't able to "see" the project as a project. I only could open Git-files.

    While importing the project for the first time (from Eclipse to Android Studio) my old .gitignore was overwritten and the new one looked like this:

    • .idea/.name
    • .idea/compiler.xml
    • .idea/copyright/profiles_settings.xml
    • .idea/encodings.xml
    • .idea/libraries/libs.xml
    • .idea/misc.xml
    • .idea/modules.xml
    • .idea/scopes/scope_settings.xml
    • .idea/vcs.xml
    • .idea/workspace.xml

    So, I tried to use an empty gitignore and now it worked. The other Android Studio could load the files and the Project. I guess some files are not important (profiles_settings.xml) for Git and importing but I am just happy it worked.

提交回复
热议问题