git-svn 尝试提交到错误的分支

发布于 2024-12-29 15:39:46 字数 952 浏览 4 评论 0原文

git-svn dcommit 正在尝试推送到错误的 SVN 分支。这就是我所做的:

git checkout -b branch_a svn/branch_a  # git-svn clone prepended all remote SVN branches with svn/
git svn branch -m "a message" branch_b
git checkout -b branch_b svn/branch_b

<make some commits>

git svn dcommit
git checkout branch_a
git svn rebase
git checkout branch_b
git rebase branch_a

这是我从 解释的“正确”分支/合并策略这个 StackOverflow 问题。

现在我陷入了困境。 branch_b 中的 git svn dcommit 尝试推送到 svn/branch_a 的 SVN URL。 git svn info 的输出证实了这一点。这也不是我想要或期望的。

有趣的是, git log --grep='^git-svn-id:' --first-parent -1 显示了正确的 SVN 分支,即 svn/branch_b 的 URL 。我读到这个命令应该来揭示 git-svn 将提交到的位置。

那么:

  1. 我做错了什么?
  2. 我该如何修复它(即将 branch_b 推送到 svn/branch_b

git-svn dcommit is trying to push to the wrong SVN branch. Here's what I did:

git checkout -b branch_a svn/branch_a  # git-svn clone prepended all remote SVN branches with svn/
git svn branch -m "a message" branch_b
git checkout -b branch_b svn/branch_b

<make some commits>

git svn dcommit
git checkout branch_a
git svn rebase
git checkout branch_b
git rebase branch_a

This is the "correct" branching/merging strategy I interpret from this StackOverflow question.

Now I'm in a pickle. git svn dcommit from branch_b attempts to push to the SVN URL for svn/branch_a. This is confirmed by the output of git svn info. This is also not what I want or expect.

Interestingly, git log --grep='^git-svn-id:' --first-parent -1 shows the correct SVN branch, the URL for svn/branch_b. I've read that this command is supposed to reveal where git-svn will dcommit to.

So:

  1. What did I do wrong?
  2. How can I fix it (i.e., push branch_b to svn/branch_b

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

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

发布评论

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

评论(1

小ぇ时光︴ 2025-01-05 15:39:46

查看您的签出命令,似乎您可能没有指示 git svn 正确跟踪远程 SVN 分支。尝试这些命令:

git checkout -b branch_a -t svn/branch_a
git checkout -b branch_b -t svn/branch_b

然后验证您在每个命令后跟踪的分支:

git svn info

然后每个分支应该跟踪正确的远程分支。

Looking over your checkout commands, it seems you may not have instructed git svn to track the remote SVN branches correctly. Try these commands:

git checkout -b branch_a -t svn/branch_a
git checkout -b branch_b -t svn/branch_b

and then verify the branch you are tracking after each with:

git svn info

Each branch should then be tracking the correct remote branch.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文