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

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

问题描述

我刚刚尝试创建一个新的 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
  • 合并
  • 平台
  • 插件
  • www

并且尝试了 phonegap local run 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/

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

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