16

I am doing my initial commit for a new android project. I am happy with the state of the code but was wondering about which files to add + commit and which files should I leave out.

Here is my .gitignore contents:

# 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

# Eclipse project files
.classpath
.project

# Proguard folder generated by Eclipse
proguard/

# Intellij project files
*.iml
*.ipr
*.iws
.idea/

Here is my current git status:

.gitignore
.gradle/
app/
build.gradle
build/
gradle/
gradlew
gradlew.bat
import-summary.txt
settings.gradle
SamIAmHarris
  • 2,158
  • 3
  • 16
  • 19
  • 2
    If you're using Android Studio - see this question http://stackoverflow.com/questions/16736856/what-should-be-in-my-gitignore-for-an-android-studio-project – nsmirosh Sep 05 '14 at 21:22
  • 4
    You can also try to assemble your .gitignore here: https://www.gitignore.io/ – Darek Kay Sep 06 '14 at 10:20
  • @DarekKay How do you use gitignore.io for the Android Studio Integrated Development Environment (IDE) ? I can get OS and Android to work fine, but not the IDE. I can't find a selection there that makes any sense for this task. Am I doing it wrong? – zipzit Feb 05 '15 at 01:03
  • @zipzit - Just type "Intellij" instead - it's the IDE, which Android Studio is based on. – Darek Kay Feb 05 '15 at 12:05
  • If you are using Gradle wrapper and defining your `.gitignore` with the help of [gitignore.io](https://www.gitignore.io/) be careful to define _Java_ ignore list **before** _Gradle_. Settings for Java will ignore all jar files: `*.jar`. And although Gradle ignore setting defines `!gradle-wrapper.jar`, wrapper jar will still be ignored by your git repository. – Igor Mar 09 '15 at 23:15

1 Answers1

4

I commit everything except the local stuff, this is my .gitignore:

*.iml
.gradle
/local.properties
/.idea
.DS_Store
/build
/captures
Dependency/*
/app/.idea/*
/app/.svn/*
/app/local.properties