对于我的Android Intellij项目,我的.gitignore中应包含哪些文件?

时间:2017-01-08 08:36:36

标签: android git intellij-idea

我有一个我已经检查过git的Android应用程序。我正在使用Intellij。当我在与最初创建应用程序的机器不同的机器上工作时,我遇到了一些文件(路径是针对不同的机器)的问题。

我可以安全地将哪些文件包含在我的gitignore中?我看到了AndroidStudio的帖子;我还应该注意Intellij的其他文件吗?

在确定我放入gitignore的文件时编辑器是否重要?

2 个答案:

答案 0 :(得分:1)

这个适用于我:

#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

答案 1 :(得分:1)

检查出来:Sample Android Project: Google

此文件取自Google的Sample Android Projects回购。

# 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