Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitignore misc.xml and *.iml with Android Studio 0.8.9

Can I just ignore into the gitignore the *.iml and misc.xml files inside and Android Studio project?

Where can I find an official gitignore for Android Studio?

like image 459
Daniel Gomez Avatar asked Oct 14 '14 14:10

Daniel Gomez


1 Answers

Can I just ignore into the gitignore the *.iml and misc.xml files inside and Android Studio project?

Sure, why not? Android Studio is generally very good at importing Android Gradle projects and recreating the IDEA files, so anyone else working on the project shouldn't have a problem checking out the project and getting it to build.

There isn't an "official" .gitignore. What you choose to ignore is generally left up to you.

Most of Android Studio's configuration files (the .iml files and everything under /.idea) are basic project configuration that you don't need to worry about. If you are making changes such as manually ignoring folders in the IDE or disabling certain IDE code quality checks, you might want to check those respective files in so you have a consistent project setup across your team. For the vast majority of projects, you do not need those files at all.

Some teams also prefer ignoring all IDE-generated files and folders to keep the project IDE-agnostic. Whether you want to do that or you want to enforce a particular IDE on your team is another decision left up to you.

When you create a new Android Studio project, it will automatically generate a .gitignore for you. The default .gitignore as of October 2014 looks like this:

.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
.idea/
app/app.iml
*.iml

Android Studio also currently generates a second .gitignore in your Android module's directory containing just /build.

like image 186
Bryan Herbst Avatar answered Oct 27 '22 20:10

Bryan Herbst