gpt4 book ai didi

svn - SVN-如何将在主干中所做的更改应用于所有分支

转载 作者:行者123 更新时间:2023-12-04 13:45:20 24 4
gpt4 key购买 nike

我是SVN的初学者。我具有SVN目录结构,如下所示:

|-trunk
|-file1.php
|-file2.php
|-branches
|-branch_1
|-file1.php
|-file2.php
|-branch_2
|-file1.php
|-file2.php

在主干中,我有应用程序的主版本。我有两个分支,分别用于不同的客户端,这些客户端仅在某些文件中有修改。当我发现一些核心错误时,将其修复在主干中。例如,我修改了 file1.php目录中的 trunk。我想将更改应用于所有分支中名为 file1.php的文件。

我有点困惑。在 Version Control with Subversion中,我找到了以下解释。

Subversion's repository has a special design. When you copy a directory, you don't need to worry about the repository growing huge—Subversion doesn't actually duplicate any data. Instead, it creates a new directory entry that points to an existing tree.



所以我虽然在提交 trunk\file1.php文件中的更改时会自动将其附加到其他 file1.php文件中,因为我没有对 branches目录中的文件进行任何更改。

如何将对中继目录的更改应用于所有分支? 我正在尝试像这样使用 svn merge:
svn merge -r 31:32 http://mysvnserver.com/project/branches/branch_1

但我没有做任何更改( svn diff -r 31:32返回我所做的所有更改。)

最佳答案

如果要将更改从trunk更改为branch_1,则merge命令需要指定从何处获取差异,然后指定将合并应用于的目标:

cd branch_1
svn merge -r 31:32 http://mysvnserver.com/project/trunk .
svn diff # confirm that the only diff is your change to file1.php
svn commit

关于svn - SVN-如何将在主干中所做的更改应用于所有分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1645409/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com