SVN:跨项目共享通用代码的最佳方法 [英] SVN: Best way to share common code across projects

查看:266
本文介绍了SVN:跨项目共享通用代码的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个存储库中有多个网站项目,每个项目都有一个WordPress副本。更新WordPress意味着更新所有项目文件夹并保留冗余副本。这对于我的同步整个文件夹的rsync脚本很有用。



我可以通过多种方法来改进它,并希望获得一些反馈。我在Windows上,最近迁移到Subversion。


  1. 在每个网站文件夹中创建指向WordPress位的符号链接。这会在Subversion和Apache中保持吗?有什么缺点吗?

  2. 只有一个WordPress文件夹并将其分支到其他网站主干中。我读到分支很便宜并且可以维护一个副本,但是我不确定是否应该跨中继进行分支。我个人认为这是最好的方法。

  3. 最后,我可以保留当前结构并使用脚本在所有网站文件夹中进行复制。

最好的方法是什么,还有其他替代解决方案吗?

解决方案

一个选项就是将WordPress比特分离到一个单独的存储库中(因为它实际上不是项目的一部分,这只是您用来构建它们的内容),然后使用svn:externals将其提取到正确位置的项目中。 / p>

SVN中的外部定义图书


I have multiple website projects in a single repository each of which have a copy of WordPress. Updating WordPress means updating all project folders and keeping redundant copies. This is useful for my rsync scripts which sync the entire folder. It also gives me fully working local copies of the site.

There are a number of ways I can see of improving this and would like some feedback. I'm on Windows and recently migrated to Subversion.

  1. Create symbolic links to the WordPress bits in each website folder. Will this hold up in Subversion and Apache. Any drawbacks?
  2. Have a single WordPress folder and branch it into the other website trunks. I read that branches are cheap and a single copy is maintained but I am not sure if branching should be done across trunks. Personally, I think this is the best approach. Is there any reason to avoid this?
  3. Lastly, I could keep the current structure and use a script to make copies across all website folders.

What's the best approach and are there any alternate solutions?

解决方案

One option would be to separate the WordPress bits out into a separate repository (since it's not really part of your projects, it's just something you use to build them), and then use svn:externals to fetch that into your projects in the correct locations.

Externals Definitions in the SVN book

这篇关于SVN:跨项目共享通用代码的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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