用于为两个不同设备开发代码的git最佳实践 [英] git best practices for developing a code for two different devices

查看:83
本文介绍了用于为两个不同设备开发代码的git最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个HTML应用程序,它将 1.使用Phonegap Build编译 2.作为纯Web应用程序在www服务器上提供

所以代码基本上是相同的,但是会有少量部分专门用于第一次或第二次修改.

但是必须将对基础代码的改进都应用于这两种改编.

那么我应该使用一个git repo并创建分支还是应该使用多个repos?

我是git的新手,所以请您编写工作流程命令吗?

解决方案

在您仍然考虑使用git的情况下,解决常见部分"的常用方法是:

  • 将它们隔离在自己的存储库中
  • 在父存储库中将所述存储库作为子模块引用.

请参见 Git子模块 . /p>

这样,您可以定义两个父存储库:

  • 一个针对app1的应用程序,其中引用了通用"存储库,另外还针对app1进行了具体开发
  • 一个针对app2的应用程序,其中引用了通用"存储库,另外还针对app2进行了具体开发

I am developing an HTML app that will be 1. compiled using Phonegap Build 2. offered as pure web app on a www server

So the code will be mainly the same but there will small parts dedicated to either the first or second adaptation.

But the improvements on the base code will have to be pushed to both adaptations.

So should I use one git repo and create branches or should I use several repos?

I am new to git so could you please write the workflow commands?

解决方案

In case you still consider git, the usual way to address "common parts" is to:

  • isolate them in their own repo
  • reference said repos as submodules in a parent repo.

See Git Submodules.

That way, you can define two parent repos:

  • one for app1, with a reference to the "common" repo, plus specific developments for app1
  • one for app2, with a reference to the "common" repo, plus specific developments for app2

这篇关于用于为两个不同设备开发代码的git最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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