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

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

    To circumvent the import of all files, where Android Studio ignores the "Ignored Files" list, but still leverage Android Studio VCS, I did the following: This will use the "Ignored Files" list from Android Studio (after import! not during) AND avoid having to use the cumbersome way Tortoise SVN sets the svn:ignore list.

    1. Use the Tortoise SVN repository browser to create a new project folder directly in the repository.
    2. Use Tortoise SVN to checkout the new folder over the top of the folder you want to import. You will get a warning that the local folder is not empty. Ignore the warning. Now you have a versioned top level folder with unversioned content.
    3. Open your project from the local working directory. VCS should now be enabled automatically
    4. Set your file exceptions in File -> Settings -> Version Control -> Ignored Files
    5. Add files to SVN from Android Studio: select 'App' in Project Structure -> VCS -> Add to VCS (this will add all files, except "Ignored Files")
    6. Commit Changes

    Going forward, "Ignored Files" will be ignored and you can still manage VCS from Android Studio.

    Cheers, -Joost

提交回复
热议问题