将 Git 与 Magento 结合使用的最佳实践? [英] Best practices for using Git with Magento?

查看:24
本文介绍了将 Git 与 Magento 结合使用的最佳实践?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究如何在与供应商的库(在本例中为 Magento)集成的同时,在我自己的存储库中最好地为自定义代码工作.就我而言,我不需要向供应商推送补丁(尽管这会是一个很大的附带好处).

I'm working at figuring out how to best work within my own repo for custom code while integrating with a vendor's library (in this case Magento). In my case, I will not need to push up patches to the vendor (although that would be a great side benefit).

我研究了 git submodule 和 git subtree.我认为 git submodule 不会满足我的需要.Magento 具有以下类型的树结构:

I've looked into git submodule and git subtree. I don't think git submodule will work for what I need. Magento has the following type of tree structure:

/app
  /code
     /community *
     /core
     /local *
  /design
     /adminhtml
     /frontend
        /base
        /yourtheme *
/lib
  /Zend
  /Varien
  /yourlib *
/js
  /yourjs *
  /varien
  /mage

在单独的文件夹中使用 git submodule 似乎效果最好(例如/是您的应用程序,而/vendor/magento 是子模块).然而,由于这种程度的交织,子模块似乎不是一个好的解决方案.我错了吗?

Using git submodule seems to work best in separate folders (e.g. / is your app and /vendor/magento is the submodule). However, with this degree of intertwining, a submodule doesn't seem like a good solution. Am I wrong about this?

这给我留下了 git subtree.但是对于 git subtree,相同的核心假设(供应商分支,顾名思义,是一个子树)并不成立.Magento 不是子树,而是我的项目适合的核心库.对吗?

That leaves me with git subtree. But with git subtree, the same core assumption (that the vendor branch is, as implied by the name, a subtree) doesn't hold true. Magento isn't a subtree, but the core library that my project fits within. Is that correct?

如果这两种 git 方法不起作用,还有其他我应该知道的方法可以完成我想要完成的任务吗?

If those two methods of git don't work, are there other ones I should know about that would do what I'm trying to accomplish?

我不愿意追求的最后一个选择是拥有一个 repo,然后我只应用最新的供应商更改(从 tarball 中提取).我不愿意追求这个,因为我觉得有供应商的日志信息(从 https://github.com/magentomirror/magento-mirror) 对整理新更新和找出影响我的更改非常有帮助.

The final option I'm reluctant to pursue is having a repo that I then just apply over the latest vendor changes (pulled in from a tarball). I'm reluctant to pursue this as I feel that having the vendor's log information (pulled from https://github.com/magentomirror/magento-mirror) would be greatly helpful in sorting through new updates and figuring out what changes have affected me.

推荐答案

我认为你可以使用 modgit 工具:https://github.com/jreinke/modgit您将能够使用 modgit clone 命令克隆一些 Magento 模块.完整示例可在此处获得:http:///www.bubblecode.net/en/2012/02/06/install-magento-modules-with-modgit/

I think you can use modgit tool for this: https://github.com/jreinke/modgit You'll be able to clone some Magento modules with modgit clone command. A full example is available here: http://www.bubblecode.net/en/2012/02/06/install-magento-modules-with-modgit/

这篇关于将 Git 与 Magento 结合使用的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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