简体   繁体   English

将android项目添加到git

[英]adding android project to git

Which are the files that I have to ignore when adding a project to git? 将项目添加到git时,我必须忽略哪些文件? Should I add the .classpath file? 我应该添加.classpath文件吗? What is the purpose of .classpath? .classpath的目的是什么? Im using eclipse and pushing to a Jenkins server 我使用eclipse并推送到Jenkins服务器

Typical gitignore file for android would include this: android的典型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

From Gitignore on github 来自Gitub的Gitignore

While creating a project in Eclipse, by default it creates a .classpath file in the project directory. 在Eclipse中创建项目时,默认情况下它会在项目目录中创建一个.classpath文件。 That file will be used for storing file names and other dependent files needed in the classpath to compile and execute the project successfully. 该文件将用于存储类路径中所需的文件名和其他相关文件,以便成功编译和执行项目。 Normally this file will be updated automatically when ever you update the project libraries etc. 通常,在更新项目库等时,此文件将自动更新。

You should add it to git in my opinion. 你应该在我看来把它添加到git中。 See this thread for more: 请参阅此主题了解更多:

.classpath and .project - check into version control or not? .classpath和.project - 检查版本控制与否?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM