.gitignore for PhoneGap / Cordova 3.0项目 - 我应该提交什么? [英] .gitignore for PhoneGap/Cordova 3.0 projects - what should I commit?

查看:345
本文介绍了.gitignore for PhoneGap / Cordova 3.0项目 - 我应该提交什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想创建一个新的phonegap 3.0项目...注意:我是新的phonegap。无论如何,我看到项目文件夹包含:

I just tried to create a new phonegap 3.0 project... Note: I'm new to phonegap. Anyways, I see the project folder contains:


  • .cordova

  • merges


  • 插件

  • www

  • .cordova
  • merges
  • platforms
  • plugins
  • www

并尝试过 phonegap本地运行android 我看到很多二进制/生成的文件在 platforms / android
这让我想知道,这个文件夹结构的什么部分应该添加到我的git存储库。
通常,我认为提交二进制文件是非常糟糕的做法。
因此,我通常会添加如 bin / obj / * .o *。pyc 等到 .gitignore ,以避免污染我的git

And having tried phonegap local run android I see a lot of binary/generated files in platforms/android. This leaves me wondering, what parts of this folder structure should I add to my git repository. Normally, I would consider it extremely poor practice to commit binary files. Hence, I would normally add patterns like bin/, obj/, *.o, *.pyc etc. to .gitignore to avoid polluting my git repository with things that only serves to create merge conflicts.

当然,应该将 www 添加到git中,但是关于项目的其他部分。他们的源代码的产品有多远,它们的项目配置是什么?

Surely, www should be added to git, but what about the other parts of the project. To what extend are they products of the source code, and to what extend are they project configuration?

你做什么?授予我是新的,所以我几乎不明白这里有什么意义...

What do you do? Granted I'm new so I barely understand what makes sense here...

推荐答案

答案取决于你的平台开发phongap应用程序,如果你遵循标准的目录结构。

The answer depends on wich platforms you're developing the phongap app, and if you're following the standard directory structure.

如果你的项目目录结构是标准的,那么你可以从这 gitignore 并根据您的需要进行修改。

If your project directory structure is standard, then you can start from this gitignore and modify it for your needs.

在经验法则,你必须排除所有生成的文件,如 bin / gen / 目录。
如果您正在开发一个Android版本的应用程序,您应该像 *。apk 一样排除构建文件。

On a rule of thumb you've to exclude all generated files like the bin/ and gen/ directories. If you're developing an Android version of your app you should exclude build files too like *.apk.

android 子目录中的所有生成的文件也应该排除:

All generated files in the android subdirectory should be excluded too:

Android/bin/
Android/gen/
Android/assets/

这篇关于.gitignore for PhoneGap / Cordova 3.0项目 - 我应该提交什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆