Git-SVN 合并失去了主干的链接
编辑:我看到这个问题之前已经被问过! git-svn:重置 master 的跟踪 拥有正确权限的人可能可以关闭这是一个副本。
我正在使用 git-svn。我最近完成了 git 中的一个分支的工作,该分支正在跟踪 SVN 中的分支。在分支工作时,我使用了以下两个命令
$ git svn rebase
$ big svn dcommit
,一切正常。 git 中的“master”正在跟踪 svn/trunk,git 中的“myBranch”正在跟踪 svn/branches/myBranch。但是当我在 git 本地合并所有内容之后,
$ git checkout master
$ git merge myBranch
我去推送...并假设 master 会推送到 svn/trunk。但事实并非如此。相反,“master”现在也推送到 svn/branches/myBranch。不知何故,当我将“myBranch”合并到“master”时,“master”的跟踪发生了变化。
我可能做错了 - 但我试图明确地“推送”到主干......
$ git svn dcommit remotes/trunk master
但是该语法失败了,现在我的
$ Committing to http://<repo>/trunk ...
dcommitted on a detached HEAD because you gave a revision argument.
The rewritten commit is: b461234...
SVN 主干仍然没有更新。
如何在 git 中合并然后将其推送到 SVN?我遵循此处的指南,这意味着我可以与正常的 git 语法合并。它只是没有跟进并解释为什么我的“master”没有跟踪我合并的分支。
我也有 git-tower 我与命令行并行使用,在我按上述方式手动合并后,塔现在“显示”下拉列表中的所有远程分支以“推送”或dcommit,但我可以' t 更改选择svn/myBranch ...这可能意味着我不能?
EDIT: I see that this question has been asked before! git-svn: reset tracking for master Someone with the right permissions can probably close this as a duplicate.
I'm using git-svn. I recently finished working on a branch in git that was tracking a branch in SVN. While working in the branch, I was using the following two commands
$ git svn rebase
$ big svn dcommit
and all was well. "master" in git was tracking svn/trunk and "myBranch" in git was tracking svn/branches/myBranch. But after I merged everything locally in git
$ git checkout master
$ git merge myBranch
I went to push ... and assumed that master would push to svn/trunk. But it didn't. Instead, "master" now ALSO pushes to svn/branches/myBranch. Somehow, when I merged "myBranch" into "master", "master's" tracking got altered.
I am probably doing this wrong - but I tried to explicitly "push" to trunk ...
$ git svn dcommit remotes/trunk master
But that syntax failed and now I've got
$ Committing to http://<repo>/trunk ...
dcommitted on a detached HEAD because you gave a revision argument.
The rewritten commit is: b461234...
with SVN trunk still not updated.
How do I merge in git and then push that to SVN? I was following the guide here which implies that I can merge with normal git syntax. It just doesn't follow up and explain why my "master" is not tracking the branch I merge in.
I also have git-tower which I use in parallel with the command line and after I manually merged as above, tower now "shows" all the remote branches in the drop down to "push" or dcommit to, but I can't change the selection from svn/myBranch ... which possibly implies that I can't?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果
master
正在跟踪您的svn
遥控器,您只需执行以下操作:当您在
master
上时。使用--dry-run
来确定您的提交的去向!如果它损坏了,您可以编辑.git/config
并修复您的svn-remote
条目:或者任何需要的内容。
If
master
is tracking yoursvn
remote, you can just do:While you're on
master
. Use--dry-run
to see where your commit is headed to be sure! If it's broken, you can edit.git/config
and fix up yoursvn-remote
entry:Or whatever it needs to be.
不,您不能将 git 合并提交到 Subversion。
从您提供的链接中阅读有关 git svn 的分支问题的段落:
No, you can't commit git merges to Subversion.
Read this paragraph about branching issues with git svn from the link you gave: