git:关于 svn dcommit 合并/变基的正确方法
我遇到以下情况(主要是因为我一开始并没有真正考虑清楚——或者更准确地说,我认为我这样做不应该成为问题,但现在我被绊倒了)
... --- A --- B1 --- ... --- Bn
... --- git-svn
: A 和 git-svn 处于相同的状态(完全相同的文件和文件内容),但它们在历史上没有任何共同点。
我想要:
... --- git-svn --- B1 --- ... --- Bn
或者至少,当我执行 svn dcommit 时,我只想获取 B1
到 Bn
的提交,而不是其他。
我不太确定 dcommit 是如何工作的。因此,如果我得到这样的结果:
... ------------ A --- B1 --- ... --- Bn
\ \
... --- git-svn -- A' ----------------- B'
dcommit 会按照我想要的方式运行吗?因为如果是这样,那就很容易得到(将 A
合并到 git-svn
确实可以很好地工作,因为它们在内容方面是相同的)。
或者我应该做某种变基?但我不想在 git-svn
上将 A
变基,只需将 B1
变基为 Bn
。
I have the following situation (mostly because I didn't really thought it through in the beginning -- or more exactly, I thought it shouldn't be a problem the way I did this but now I am stumbled):
... --- A --- B1 --- ... --- Bn
... --- git-svn
Whereby A
and git-svn
are at the same state (exactly the same files and file content) but they don't have any common point in history.
And I want:
... --- git-svn --- B1 --- ... --- Bn
Or at least, when I do the svn dcommit, I want exactly to get the commits B1
to Bn
and nothing else.
I am not exactly sure how dcommit works. So if I would get something like this:
... ------------ A --- B1 --- ... --- Bn
\ \
... --- git-svn -- A' ----------------- B'
would the dcommit behave in the way I want? Because if so, that would be easy to get (merging A
into git-svn
does work just fine because they are content-wise the same).
Or should I do some sort of rebase? But I don't want to rebase A
on git-svn
, just B1
to Bn
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
dcommit
为从git-svn
到HEAD
(或您指定的提交)的每次提交执行svn commit
。我认为你的最后一句话就是我的处理方式:将
B1
重新设置为Bn
到git-svn
上。这是按如下方式完成的:dcommit
does ansvn commit
for each commit fromgit-svn
toHEAD
(or the commit you specify).I think your last sentence is the way I'd approach it: rebase
B1
toBn
ontogit-svn
. This is done as follows: