什么文件应该在我的。gitignore为一个Android工作室项目?
我见过几个包含。iml的例子,但是IntelliJ文档说。iml必须包含在你的源代码控制中。
什么文件应该在我的。gitignore为一个Android工作室项目?
我见过几个包含。iml的例子,但是IntelliJ文档说。iml必须包含在你的源代码控制中。
当前回答
编译:
#built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
# Gradle files
.gradle/
build/
/*/build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# 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/
# Intellij project files
*.iml
*.ipr
*.iws
.idea/
其他回答
编译:
#built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
# Gradle files
.gradle/
build/
/*/build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# 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/
# Intellij project files
*.iml
*.ipr
*.iws
.idea/
我的建议是不要忽略。idea文件夹。
我已经将一个基于git的Eclipse项目导入到Android Studio,效果很好。后来,我想用Git导入这个项目(就像第一次一样)到另一台带有Android Studio的机器上,但没有成功。Android Studio确实加载了所有文件,但无法将项目“视为”项目。我只能打开Git-files。
当第一次导入项目(从Eclipse到Android Studio)时,我的旧的.gitignore被覆盖了,新的看起来像这样:
.idea / . name .idea / compiler.xml .idea /版权/ profiles_settings.xml .idea / encodings.xml .idea /图书馆/ libs.xml .idea / misc.xml .idea / modules.xml .idea /范围/ scope_settings.xml .idea / vcs.xml .idea / workspace.xml
所以,我试着用一个空的gitignore,现在它工作了。另一个Android Studio可以加载文件和项目。我猜有些文件对于Git和导入来说并不重要(profiles_settings.xml),但我很高兴它起作用了。
从Android Studio 0.8.4开始,启动新项目时自动生成gitignore文件。 默认情况下,它包含:
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
从Android Studio 0.8.4开始,启动新项目时自动生成gitignore文件。默认情况下,它包含:
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
build/
/captures
我同意这个说法,但是我修改了这个文件来改变 /建造到建造/ (包括/build和/app/build) 这样我就不会把所有的文件都放在app/build中。
还要注意,如果从Eclipse导入项目,.gitignore不会被复制,也不会“自动地”为您创建。
这是通过这里生成。gitignore的最好方法