如何从某个版本copy/re-apply修改为working/head版本?
How to copy/re-apply changes from a certain revision to the working/head revision?
我们正在做一个项目,然后突然有人 uncooperative/stubborn 进来并检查了一些搞砸了项目的东西 - 使它无法构建但对我的模块没有影响。所以我们在使用最后一个已知的工作修订版的同时仍在工作,我像往常一样检查了我的更改。然后项目经理决定将所有内容恢复到最后一个已知的工作修订版 (r1810),它变成了 r1824。
现在,如何重新应用我在 1814、1815 和 1821 中的修订?
大部分时间我在 Windows 资源管理器上使用 Tortoise SVN,在 Visual Studio 上使用 AnkhSVN,所以我可以说在使用 SVN 时我仍然是使用命令提示符的新手.
您需要"cherry-pick"这些更改。
引用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
因为它们是
使用单一分支进行开发。
我们正在做一个项目,然后突然有人 uncooperative/stubborn 进来并检查了一些搞砸了项目的东西 - 使它无法构建但对我的模块没有影响。所以我们在使用最后一个已知的工作修订版的同时仍在工作,我像往常一样检查了我的更改。然后项目经理决定将所有内容恢复到最后一个已知的工作修订版 (r1810),它变成了 r1824。
现在,如何重新应用我在 1814、1815 和 1821 中的修订?
大部分时间我在 Windows 资源管理器上使用 Tortoise SVN,在 Visual Studio 上使用 AnkhSVN,所以我可以说在使用 SVN 时我仍然是使用命令提示符的新手.
您需要"cherry-pick"这些更改。
引用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 betweenARG1
andARG2
, 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
因为它们是
使用单一分支进行开发。