在不同的项目/存储库之间共享代码?
我一直在使用 git-svn 从 svn 克隆的 git 存储库在本地开发一个项目。我现在需要添加来自不同 svn 存储库的一些代码。该代码是模块化的,因此新代码将位于一个不与现有代码重叠的新子目录中。我在本地开发环境中使用 git-svn,临时服务器是 svn checkout,实时服务器是 svn 导出。
对于某些上下文,我正在两个独立的 Drupal 站点上工作,每个站点都有自己的 svn 存储库。站点 A 有一些自定义模块,现在需要添加到站点 B。管理单独站点和站点的最佳方法是什么?回购?
看来我最好设置第三个单独的 svn 存储库,其中包含在站点之间共享的模块。如果是这样,在单个项目中使用两个单独的存储库的最佳方法是什么?
编辑:我特别感兴趣的是其他人在跨多个站点将 Drupal 贡献的模块与自定义模块混合时如何处理版本控制。我如何改进第一段最后一句中描述的设置?
I have been working on a project locally using a git repo cloned from svn using git-svn. I now need to add in some code from a different svn repo. The code is modular, so the new code will be in a new subdirectory that does not overlap the existing code. I use git-svn on my local development environment, the staging server is an svn checkout, and the live server is an svn export.
For some context, I'm working on two separate Drupal sites, each with their own svn repo. Site A has some custom modules that now need to be added to Site B. What is the best way to manage the separate sites & repos?
It seems like I may be better off setting up a third separate svn repo that contains modules that are shared between sites. If so, what is the best way to work with two separate repos in a single project?
EDIT: I'm especially interested in how others handle version control when mixing Drupal contributed modules with custom modules, across multiple sites. How might I improve on the setup described in the last sentence of the first paragraph?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 外部定义其他存储库的工作副本中的子目录。
You can use Externals Definitions for having subdirectories in your working copy of other repositories.
您正在使用 Drupal 6 的多站点功能吗?对于我的开发,我在sites/all/modules中拥有用于每个网站的模块,在sites/example1.com/modules、sites/example2.com/modules等中拥有每个项目的独特模块,以及每个子目录都有一个 git 存储库。
我还在开发计算机上安装了 http://drupal.org/node/231298 处的补丁,它反向移植了 D7 的一项功能,使事情变得更加流畅。
Are you using Drupal 6's multisite capability? For my development, I have the modules that I use for every website in sites/all/modules, and the unique modules for each project in sites/example1.com/modules, sites/example2.com/modules, and so on, with a git repository for each subdirectory.
I also have the patch at http://drupal.org/node/231298 installed on the development machine, which backports a feature from D7 that makes things even smoother.