git 首先提交 Android Studio 项目——应该遗漏什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25693964/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 10:21:46  来源:igfitidea点击:

First commit Android Studio Project -- What should leave out?

androidgitandroid-studiogitignore

提问by SamIAmHarris

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.

我正在为一个新的 android 项目做我的初始提交。我对代码的状态很满意,但想知道要添加和提交哪些文件以及我应该省略哪些文件。

Here is my .gitignore contents:

这是我的 .gitignore 内容:

# 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:

这是我当前的 git 状态:

.gitignore
.gradle/
app/
build.gradle
build/
gradle/
gradlew
gradlew.bat
import-summary.txt
settings.gradle

回答by Flummox - don't be evil SE

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

我提交了除本地内容之外的所有内容,这是我的 .gitignore:

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