0

I have an android app that I've checked into git. I am using Intellij. I've run into issues with some of the files (paths are for a different machine) when I work on a different machine than the one I originally created the application on.

Which files can I safely include in my gitignore? I saw the post for AndroidStudio; are there any additional files that I should be aware for for Intellij?

Does the editor matter when determining which files I put in my gitignore?

Community
  • 1
  • 1
sparkyShorts
  • 630
  • 9
  • 28

2 Answers2

1

This one works for me:

#built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# Git backup files
*.orig

# generated files
gen/

# Local configuration file (sdk path, etc)
local.properties

# Windows thumbnail db
Thumbs.db

# OSX files
.DS_Store

# Android Studio
.idea/*
.gradle/*
build/*
*.iml
gradle.properties
Vasiliy
  • 16,221
  • 11
  • 71
  • 127
1

Check this out: Sample Android Project: Google

This file is taken from the Sample Android Projects repo by Google.

# 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/
proguard-project.txt

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

*.pydevproject
.project
.metadata
.gradle
build/**
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

# Android Studio project files
*.iml
.gradle
.idea
build
import-summary.txt
code
  • 2,115
  • 1
  • 22
  • 46
  • I don't think that including `bin/` is a good idea - I use this folder for project-specific scripts, which definitely need to be tracked. – Vasiliy Jan 08 '17 at 09:23
  • @Vasiliy `bin/` is generally used by build systems for temporary or intermediate files and other artifacts. I would not recommend it as a place to store important files. You are better off creating a separate folder (e.g. `scripts` or `tools`) to house your scripts and track that instead. – Frelling Jan 08 '17 at 18:51