Skip to content

Instantly share code, notes, and snippets.

@iainconnor
Created January 24, 2014 20:20
Show Gist options
  • Save iainconnor/8605514 to your computer and use it in GitHub Desktop.
Save iainconnor/8605514 to your computer and use it in GitHub Desktop.
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
.gradle/
# Signing files
.signing/
# User-specific configurations
.idea/libraries/
.idea/workspace.xml
.idea/tasks.xml
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
*.iml
# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
@mhd-adeeb-masoud
Copy link

Thanks! always useful

@raghukraman
Copy link

raghukraman commented Nov 24, 2016

Thanks. very useful. if any directory is already staged, then you can use the following command to remove all the staged files under that directory.

git rm --cached -rf .idea

@rooksoto
Copy link

Very helpful, thanks!

@parzibyte
Copy link

Thank you! :)

@alex-chaliy
Copy link

Клёво, клёво, клёво

@lewisevans
Copy link

You may want to add /captures and .externalNativeBuild also

@arkayapps
Copy link

Thanks.

@ABCsHub
Copy link

ABCsHub commented Dec 30, 2017

i are making a Operating System with linux. i will use these gitignore :) 👌

Gabriel Pereira

@lddatacom
Copy link

Hi,

Not sure if there is something wrong but when I applied this gitignore file, all xml files in the project is ignored as well. Anyone got same issue or know how to solve it?

Thanks.

@karimkod
Copy link

karimkod commented Mar 2, 2018

Thank you :D

@fari-99
Copy link

fari-99 commented Apr 10, 2018

thanks you so much

@salouri
Copy link

salouri commented Aug 8, 2018

thank you. I also think /*/build/ should be **/build/

@jackycaojiaqi
Copy link

thanks @salouri you save my time

@LuckyTeng
Copy link

thanks, this is really saving my time:)

@MarcinKulwicki
Copy link

.gitignore you must create in root folder.
Change view from Android -> Project and in MyAppFolder create .gitignore.

@gauravsngarg
Copy link

Thanks for this post. it helped.

@vjayrajput
Copy link

Hi,

Not sure if there is something wrong but when I applied this gitignore file, all xml files in the project is ignored as well. Anyone got same issue or know how to solve it?

Thanks.

I am facing the same problem nowadays. Do you find a solution?

@avaiyakirtib
Copy link

Thanks, This helps

@sulemankhan447
Copy link

I know this sounds stupid but where do I put/find my .gitignore file in Android Studio? :(

In your root folder of Project

@Arman-Hosseini
Copy link

The iml pattern should be like this: /*/*.iml for every library

@CarlesRa
Copy link

Nice, thanks!!

@atembamanu
Copy link

Awesome, thanks

@vishudh
Copy link

vishudh commented Mar 31, 2020

Thank you

@Jazz4Dayz
Copy link

Is this up to date?

@bhapps
Copy link

bhapps commented Jul 25, 2020

I used git rm -r --cached ./
reset all committed files to start over with Git.

@mnementh64
Copy link

👍

@R0land013
Copy link

Thank you

@hyperov
Copy link

hyperov commented May 14, 2022

amazing. thank you

@Kishangalgotra
Copy link

hi this file is not working for me

@Varzil
Copy link

Varzil commented Sep 8, 2022

Thanks. This works very well

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