SVN:跨项目共享通用代码的最佳方法

编程入门 行业动态 更新时间:2024-10-28 06:26:47
本文介绍了SVN:跨项目共享通用代码的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

  • 在每个网站文件夹中创建指向WordPress位的符号链接。这会在Subversion和Apache中保持吗?有什么缺点吗?
  • 只有一个WordPress文件夹并将其分支到其他网站主干中。我读到分支很便宜并且可以维护一个副本,但是我不确定是否应该跨中继进行分支。我个人认为这是最好的方法。
  • 最后,我可以保留当前结构并使用脚本在所有网站文件夹中进行复制。
  • 最好的方法是什么,还有其他替代解决方案吗?

    解决方案

    一个选项就是将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.

  • Create symbolic links to the WordPress bits in each website folder. Will this hold up in Subversion and Apache. Any drawbacks?
  • 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?
  • 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:跨项目共享通用代码的最佳方法

    本文发布于:2023-11-08 11:51:24,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1569295.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:代码   方法   项目   SVN

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!