问题描述
文件应该在我的.gitignore了一个Android Studio项目是什么?
What files should be in my .gitignore for an Android Studio project?
我见过几个例子,所有的包括.iml但的IntelliJ文档说.iml必须包含在你的源代码控制。
I have seen several examples that all include .iml but IntelliJ docs say that .iml must be included in your source control.
推荐答案
更新:
由于Android的工作室1.0,新项目与此gitignore文件创建:
Update:Since Android Studio 1.0, new projects are created with this gitignore file:
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
验证它是否适合你的需要,如果没有,请继续阅读。
Verify if it suits your needs and if not, read on.
previous:
一个迟到的答案,但没有一个答案在这里和here是正确的金钱对我们来说...
A late answer but none of the answers here and here was right on the money for us...
所以,这里是我们的gitignore文件:
So, here's our gitignore 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
# Windows thumbnail db
Thumbs.db
# OSX files
.DS_Store
# Eclipse project files
.classpath
.project
# Android Studio
*.iml
.idea
#.idea/workspace.xml - remove # and delete .idea if it better suit your needs.
.gradle
build/
#NDK
obj/
可选 - 用于旧项目格式,添加此部分,将gitignore文件:
Optional - for older project format, add this section to your gitignore file:
/*/out
/*/*/build
/*/*/production
*.iws
*.ipr
*~
*.swp
此文件应位于项目的根文件夹,而不是项目的模块文件夹内。
This file should be located in the project's root folder and not inside the project's module folder.
编辑备注:
-
由于版本0.3+似乎可以提交和推送的 * IML 和的build.gradle 文件。如果你的项目是基于摇篮:在新打开/导入对话框,你应该检查
使用自动导入
复选框并标记使用默认gradle这个包装(推荐)
单选按钮。所有路径现在相对的@George建议。
Since version 0.3+ it seems you can commit and push *.iml and build.gradle files. If your project is based on Gradle: in the new open/import dialog, you should check the
"use auto import"
checkbox and mark the"use default gradle wrapper (recommended)"
radio button. All paths are now relative as @George suggested.
更新答案
这篇关于应该是在我的.gitignore了一个Android Studio项目是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!