从Git到SVN:无法在更改中合并 [英] From Git to SVN: Failed to merge in the changes

查看:110
本文介绍了从Git到SVN:无法在更改中合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Git仓库中有一些代码需要与SVN仓库进行同步。我的食谱看起来像这样:

I have some code in a Git repository that needs to be synchronized with a SVN repository. My recipe looks like this:


  1. 创建一个SVN仓库(用于测试的本地仓库将是一个远程仓库)。 b $ b
  2. 创建初始版式,提交1版本
  3. git svn clone -T'/ trunk'< REPO> 基于初始提交的新Git仓库。
  4. c> git remote add dev< ORIGINAL> > git pull dev< ORIGINAL_BRANCH> 。现在,我的存储库中的主分支基于最初的SVN提交。
  5. git svn rebase 后面跟着 dcommit

  1. Create a SVN repository (local, for testing, will be a remote one).
  2. Create initial layout, commit 1 revision
  3. git svn clone -T '/trunk' <REPO> a new Git repository based on the initial commit.
  4. git remote add dev <ORIGINAL> followed by a git pull dev <ORIGINAL_BRANCH>. Now I have my master branch in the repository based on the initial SVN commit.
  5. git svn rebase which would be followed by dcommit.

然而,步骤5)失败:

Step 5) however fails with:

Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging X
Applying: Y
Applying: Z
Using index info to reconstruct a base tree...
<stdin>:269: trailing whitespace.

<stdin>:315: trailing whitespace.

<stdin>:400: trailing whitespace.
     * Method 2.6. Returns zero or two elements 
<stdin>:3762: trailing whitespace.

warning: 4 lines add whitespace errors.
Falling back to patching base and 3-way merge...

后面跟着一对夫妇的自动合并和CONFLICT(内容)消息,rebase最终会以友好的合并失败停止。我能做些什么来自动解决这些冲突?我甚至不知道如何重新绑定时发生冲突!

Followed by a couple of "Auto-merging" and "CONFLICT (content)" messages the rebase finally halts with a friendly "Failed to merge in the changes". Is there anything I can do to have these conflicts resolved automatically? I do not even understand how conflicts can occur when rebasing!

推荐答案

我放弃并使用 set而不是。一个 git rebase -p 会生成一个历史记录,其中包含人工git-svn的初始提交,后接原始Git存储库的初始提交...

I am giving up and use set-tree instead. A git rebase -p results in a history with the artificial git-svn initial commit at root, followed by the initial commit from the original Git repository...

为了完整性,我尝试了三种方法的参考:

For completeness my references for the three approaches tried:


  1. http://code.google.com/p/support/wiki/ImportingFromGit - git rebase

  2. http:// markpasc .livejournal.com / 186297.html - git svn rebase

  3. http://repo.or.cz/w/nagiosplugins.git?a=blob;f = tools / git2svn.pl - set-tree

  1. http://code.google.com/p/support/wiki/ImportingFromGit - git rebase
  2. http://markpasc.livejournal.com/186297.html - git svn rebase
  3. http://repo.or.cz/w/nagiosplugins.git?a=blob;f=tools/git2svn.pl - set-tree

这篇关于从Git到SVN:无法在更改中合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆