gpt4 book ai didi

svn - 如何将某个修订版的更改复制/重新应用到工作/头修订版?

转载 作者:行者123 更新时间:2023-12-02 20:33:11 25 4
gpt4 key购买 nike

我们正在开发一个项目,然后突然有一些不合作/顽固的家伙介入并检查了一些搞砸了项目的东西 - 使其无法构建,但对我的模块没有影响。因此,我们仍在使用最后一个已知的工作修订版进行工作,并且我像平常一样检查了我的更改。然后项目经理决定将所有内容恢复到最后一个已知的工作修订版 (r1810),它变成了 r1824。

现在,如何重新应用 1814 年、1815 年和 1821 年的修订?

我大部分时间在 Windows 资源管理器上使用 Tortoise SVN,在 Visual Studio 上使用 AnkhSVN,所以我可以说,在使用 SVN 时使用命令提示符我仍然是新手。

最佳答案

您需要“挑选”这些更改。

引用the manual :

<…> the term cherrypicking. This word refers to the act of choosing one specific changeset from a branch and replicating it to another. Cherrypicking may also refer to the act of duplicating a particular set of (not necessarily contiguous!) changesets from one branch to another. This is in contrast to more typical merging scenarios, where the “next” contiguous range of revisions is duplicated automatically.

要进行挑选,请使用 svn merge -c 1814 ^whatever/branch ;再次引用 the manual :

--change (-c) ARG

Perform the requested operation using a specific “change”. Generally speaking, this option is syntactic sugar for -r ARG-1:ARG. Some subcommands permit a comma-separated list of revision number arguments (e.g., -c ARG1,ARG2,ARG3). Alternatively, you can provide two arguments separated by a dash (as in -c ARG1-ARG2) to identify the range of revisions between ARG1 and ARG2, inclusive. Finally, if the revision argument is negated, the implied revision range is reversed: -c -45 is equivalent to -r 45:44.

更新:按照OP的建议,他们需要使用 --ignore-ancestry命令行选项 svn merge -c因为他们是使用单一分支进行开发。

关于svn - 如何将某个修订版的更改复制/重新应用到工作/头修订版?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47987430/

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