如何将分支合并到主干?

发布于 2024-12-06 09:52:00 字数 310 浏览 0 评论 0原文

我在 SVN merge 方面遇到了一个特殊问题。我想从开发分支合并到主干。 我们有多个开发分支同时切断了主干。

我使用以下命令将这些分支之一合并到主干:

svn merge trunk branch_1

我看到不属于该分支的更改被合并到主干中。 我做错了什么?

SVN版本:

Subversion 命令行客户端,版本 1.6.16-SlikSvn-tag-1.6.16@1076804-WIN32。

I'm facing a peculiar problem with SVN merge. I want to merge from a dev branch to trunk.
We have multiple dev branches cut off the trunk at the same time.

I'm merging one of those branches to trunk with this command:

svn merge trunk branch_1

I see changes that are not part of this branch, getting merged into trunk.
What am I doing wrong ?

SVN Version :

Subversion command-line client, version
1.6.16-SlikSvn-tag-1.6.16@1076804-WIN32.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

九局 2024-12-13 09:52:00

您的svn merge语法错误。

您想要签出trunk的工作副本,然后使用svn merge - -reintegrate 选项:

$ pwd
/home/user/project-trunk

$ svn update  # (make sure the working copy is up to date)
At revision <N>.

$ svn merge --reintegrate ^/project/branches/branch_1
--- Merging differences between repository URLs into '.':
U    foo.c
U    bar.c
 U   .

$ # build, test, verify, ...

$ svn commit -m "Merge branch_1 back into trunk!"
Sending        .
Sending        foo.c
Sending        bar.c
Transmitting file data ..
Committed revision <N+1>.

请参阅SVN 书籍中有关合并的章节< /a> 对于更多细节。


请注意,在撰写本文时,这是正确的答案(并且已被接受),但事情已经发生了变化。请参阅topek的答案,以及http://subversion.apache.org/docs/release -notes/1.8.html#自动重新集成

Your svn merge syntax is wrong.

You want to checkout a working copy of trunk and then use the svn merge --reintegrate option:

$ pwd
/home/user/project-trunk

$ svn update  # (make sure the working copy is up to date)
At revision <N>.

$ svn merge --reintegrate ^/project/branches/branch_1
--- Merging differences between repository URLs into '.':
U    foo.c
U    bar.c
 U   .

$ # build, test, verify, ...

$ svn commit -m "Merge branch_1 back into trunk!"
Sending        .
Sending        foo.c
Sending        bar.c
Transmitting file data ..
Committed revision <N+1>.

See the SVN book chapter on merging for more details.


Note that at the time it was written, this was the right answer (and was accepted), but things have moved on. See the answer of topek, and http://subversion.apache.org/docs/release-notes/1.8.html#auto-reintegrate

失眠症患者 2024-12-13 09:52:00

如果您的工作目录指向主干,那么您应该能够合并您的分支:

svn merge https://HOST/repository/branches/branch_1

请务必在主干的根目录中发出此命令

If your working directory points to the trunk, then you should be able to merge your branch with:

svn merge https://HOST/repository/branches/branch_1

be sure to be to issue this command in the root directory of your trunk

杯别 2024-12-13 09:52:00

在主干中执行 svn update,记下修订号。

从主干:

svn merge -r<revision where branch was cut>:<revision of trunk> svn://path/to/branch/branchName

您可以通过执行 svn log 检查分支从主干中被切断的位置

svn log --stop-on-copy

Do an svn update in the trunk, note the revision number.

From the trunk:

svn merge -r<revision where branch was cut>:<revision of trunk> svn://path/to/branch/branchName

You can check where the branch was cut from the trunk by doing an svn log

svn log --stop-on-copy
待"谢繁草 2024-12-13 09:52:00

语法错误,应该是

svn merge <what(the range)> <from(your dev branch)> <to(trunk/trunk local copy)>

The syntax is wrong, it should instead be

svn merge <what(the range)> <from(your dev branch)> <to(trunk/trunk local copy)>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文