.gitignore pour Android Studio
34 règles d’exclusion pour Android Studio, prêtes à copier dans votre dépôt.
IDE officiel pour le développement Android
Le .gitignore complet pour Android Studio
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:28:52 UTC
# Technologies: Android Studio
### Android Studio ###
# IntelliJ workspace settings
.idea/**/workspace.xml
# IntelliJ tasks
.idea/**/tasks.xml
# IntelliJ usage statistics
.idea/**/usage.statistics.xml
# IntelliJ user dictionaries
.idea/**/dictionaries
# IntelliJ shelved changes
.idea/**/shelf
.idea/**/aws.xml
# IntelliJ content model
.idea/**/contentModel.xml
# IntelliJ database configurations
.idea/**/dataSources/
# IntelliJ datasource IDs
.idea/**/dataSources.ids
# IntelliJ local datasources
.idea/**/dataSources.local.xml
# IntelliJ SQL datasources
.idea/**/sqlDataSources.xml
# IntelliJ dynamic elements
.idea/**/dynamic.xml
# IntelliJ UI designer
.idea/**/uiDesigner.xml
# IntelliJ database navigator
.idea/**/dbnavigator.xml
# IntelliJ Gradle settings
.idea/**/gradle.xml
# IntelliJ project libraries
.idea/**/libraries
cmake-build-*/
.idea/**/mongoSettings.xml
# IntelliJ workspace file
*.iws
out/
.idea_modules/
atlassian-ide-plugin.xml
.idea/replstate.xml
.idea/sonarlint/
# see https://community.sonarsource.com/t/is-the-file-idea-idea-idea-sonarlint-xml-intended-to-be-under-source-control/121119
.idea/sonarlint.xml
com_crashlytics_export_strings.xml
# Crashlytics config
crashlytics.properties
# Crashlytics build
crashlytics-build.properties
# Fabric properties
fabric.properties
.idea/httpRequests
http-client.private.env.json
.idea/caches/build_file_checksums.ser
.idea/.cache/.Apifox_Helper
.idea/ApifoxUploaderProjectSetting.xml
Ce que ces règles Android Studio ignorent vraiment
Chaque motif ci-dessous, et pourquoi il a sa place dans votre .gitignore.
User-specific stuff
| Motif | Ce qu’il ignore |
|---|---|
.idea/**/workspace.xml |
IntelliJ workspace settings |
.idea/**/tasks.xml |
IntelliJ tasks |
.idea/**/usage.statistics.xml |
IntelliJ usage statistics |
.idea/**/dictionaries |
IntelliJ user dictionaries |
.idea/**/shelf |
IntelliJ shelved changes |
AWS User-specific
| Motif | Ce qu’il ignore |
|---|---|
.idea/**/aws.xml |
AWS User-specific |
Generated files
| Motif | Ce qu’il ignore |
|---|---|
.idea/**/contentModel.xml |
IntelliJ content model |
Sensitive or high-churn files
| Motif | Ce qu’il ignore |
|---|---|
.idea/**/dataSources/ |
IntelliJ database configurations |
.idea/**/dataSources.ids |
IntelliJ datasource IDs |
.idea/**/dataSources.local.xml |
IntelliJ local datasources |
.idea/**/sqlDataSources.xml |
IntelliJ SQL datasources |
.idea/**/dynamic.xml |
IntelliJ dynamic elements |
.idea/**/uiDesigner.xml |
IntelliJ UI designer |
.idea/**/dbnavigator.xml |
IntelliJ database navigator |
Gradle
| Motif | Ce qu’il ignore |
|---|---|
.idea/**/gradle.xml |
IntelliJ Gradle settings |
.idea/**/libraries |
IntelliJ project libraries |
CMake
| Motif | Ce qu’il ignore |
|---|---|
cmake-build-*/ |
CMake |
Mongo Explorer plugin
| Motif | Ce qu’il ignore |
|---|---|
.idea/**/mongoSettings.xml |
Mongo Explorer plugin |
File-based project format
| Motif | Ce qu’il ignore |
|---|---|
*.iws |
IntelliJ workspace file |
IntelliJ
| Motif | Ce qu’il ignore |
|---|---|
out/ |
IntelliJ |
.idea_modules/ |
mpeltonen/sbt-idea plugin |
JIRA plugin
| Motif | Ce qu’il ignore |
|---|---|
atlassian-ide-plugin.xml |
JIRA plugin |
Cursive Clojure plugin
| Motif | Ce qu’il ignore |
|---|---|
.idea/replstate.xml |
Cursive Clojure plugin |
SonarLint plugin
| Motif | Ce qu’il ignore |
|---|---|
.idea/sonarlint/ |
SonarLint plugin |
.idea/sonarlint.xml |
see https://community.sonarsource.com/t/is-the-file-idea-idea-idea-sonarlint-xml-intended-to-be-under-source-control/121119 |
Crashlytics plugin (for Android Studio and IntelliJ)
| Motif | Ce qu’il ignore |
|---|---|
com_crashlytics_export_strings.xml |
Crashlytics plugin (for Android Studio and IntelliJ) |
crashlytics.properties |
Crashlytics config |
crashlytics-build.properties |
Crashlytics build |
fabric.properties |
Fabric properties |
Editor-based HTTP Client
| Motif | Ce qu’il ignore |
|---|---|
.idea/httpRequests |
Editor-based HTTP Client |
http-client.private.env.json |
Editor-based HTTP Client |
Android studio 3.1+ serialized cache file
| Motif | Ce qu’il ignore |
|---|---|
.idea/caches/build_file_checksums.ser |
Android studio 3.1+ serialized cache file |
Apifox Helper cache
| Motif | Ce qu’il ignore |
|---|---|
.idea/.cache/.Apifox_Helper |
Apifox Helper cache |
.idea/ApifoxUploaderProjectSetting.xml |
Apifox Helper cache |
Comment utiliser ce .gitignore pour Android Studio
- Copiez les règles Android Studio ci-dessus, ou téléchargez directement le fichier.
- Créez un fichier nommé .gitignore à la racine de votre dépôt Git et collez-y les règles.
- Si certains de ces fichiers sont déjà suivis, lancez git rm -r --cached . puis recommitez — Git n’applique les règles d’exclusion qu’aux fichiers non suivis.
- Commitez le .gitignore pour que toute l’équipe partage les mêmes règles.