gitignore should list the names or name-patterns of files that will be found in work-trees when working with your project, but that should not be committed to the project. In other words, it's not OS-specific, it's project-specific.
Gradle compiles java files and generates class files in the target folder.so These files add to gitignore. The archive files created by the final application are in the jar, ear, and war formats. The following entries add to the gitignore file for package-related files.
You can mix Android.gitignore:
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
# Local configuration file (sdk path, etc)
local.properties
with Eclipse.gitignore:
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
In addition to what the others have suggested, I'd like to add the proguard
folder, in case you are using it. You can either ignore the whole folder or just dump.txt
, seeds.txt
and usage.txt
. Basically, it's a good idea to keep mapping.txt
versioned, so that you can debug obfuscated stack traces from your users. More details here.
This is my standard Android .gitignore
and .hgignore
file. It usually works pretty well.
bin
gen
target
.settings
.classpath
.project
*.keystore
*.swp
*.orig
*.log
*.properties
seed.txt
map.txt
It has eclipse, vim .swp files, mavens target folder and files for proguard mapping included.
Update: I have put my .gitignore for Android development online.
Well I know that the github/gitignore repository on GitHub has an android .gitignore file. This might be what you want as it should be very general for android development.
The actual content of the mentioned file:
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
# Local configuration file (sdk path, etc)
local.properties
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With