Skip to content

Instantly share code, notes, and snippets.

@AdamMc331
Created August 26, 2019 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamMc331/a911c07f747af306ff6feb055df065d1 to your computer and use it in GitHub Desktop.
Save AdamMc331/a911c07f747af306ff6feb055df065d1 to your computer and use it in GitHub Desktop.
My notes from a talk at Droidcon NYC about the .idea folder.

git rm -r —cached .idea? - Harry Grillo

What is this folder?

Comes from the IDE Intellij, which AS is forked from and that’s why we have it.

Projects are directory based, which is what the .idea/ folder is for.

The gitignore file is often kind of spotty about what’s ignored and what isn’t. But now there’s a fixed set of lines (that are also what the presenter recommends).

libraries/

Meta data around libraries in the project. We don’t want to include this because dependency management tools are what’s responsible for setting this up (like gradle).

workspace.xml

Don’t include this because it is stuff specific to this developer, like state of your IDE windows. Editor tabs, cursor, windows, etc.

assertWizardSettings.xml

Literally just for asset settings like image assets.

caches/

Tell by name you don’t want to persist data. This caches grade files specifically, which allows you to see if gradle files changes.

codeStyles/

This SHOULD be shared by developers. You probably want everyone on the team to auto format in the same way, which is what this folder is for. Doesn’t change often, everyone should have it.

dictionaries/

If you put everything in here, AS collects them and puts them into a master list so things aren’t recognized as typos for anyone on the team. This is great for anyone on the team.

inspectionProfiles/

This is where lint rules go. You want to share that with everyone.

misc.xml

This holds the java version, there used to be a bug with that but it seems like that may have been fixed. More about the project and not the user, so it /might/ be worth including.

navEditor.xml

For navigation layout editing. Android team puts this in gitignore by default, but the presenter thinks it can be up to you because it will allow you to share things among the team.

runConfigurations.xml

For large projects with a lot of different modules, you can have some cool things. If you share this XML file in git it will show up for everyone.

vcs.xml

Consistent version control work for everyone. This has the configuration to say what type of VCS you’re using and how it’s set up. This is really helpful if the whole team is using AS for git, but for external tools maybe not.

Others

There may be more to it, but this is what the presenter has seen. Questions to ask before you commit it?

  • Is it NOT unique to your machine?
  • Would it be useful to teammates? Is it NOT personal preference)
  • Does it NOT change on every commit?
  • Make sure it is specific to the project, NOT the IDE.

IDE settings can still be imported and exported, but this should be done independently of git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment