Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>These conflicts have nothing to do with git-svn.</p> <p>If one has a couple of remotes: remote1 and remote2, and the history of these remotes has diverged, then rebase operation always rewrites the history of first remote on top of another.</p> <p>Suppose one has a single commit A referenced by master branch:</p> <pre><code>$ git log master * commit A Initial commit </code></pre> <p>And a couple of remotes with a diverged history:</p> <pre><code>$ git log remote1/master * commit R1 Added conflict.txt at remote1 * commit A Initial commit </code></pre> <p>and</p> <pre><code>$ git log remote2/master * commit R2 Added conflict.txt at remote2 * commit A Initial commit </code></pre> <p>Now one rebases the local history as follows:</p> <pre><code>$ git rebase remote1/master $ git log master * commit R1 Added conflict.txt at remote1 * commit A Initial commit </code></pre> <p>Now one tries to rebase the local history on top of remote2/master, gets conflicts and resolves them:</p> <pre><code>$ git rebase remote2/master $ git log master * commit R1 Added conflict.txt at remote1 * commit R2 Added conflict.txt at remote2 * commit A Initial commit </code></pre> <p>Noticed? Rebase operation puts commit R1 on top of R2. As you may expect, rebasing the given history on top of remote1/master just swaps commits R1 and R2 and generates exactly the same conflicts.</p> <p>How to fix that? Well, you have to make the history the same for both remotes. The safest way to do that is to merge commits R1 and R2 and push the resulting merge commit to both remote1 and remote2.</p> <p>Now back to git-svn. For your case, merging the diverged history won't work as git-svn always rewrites your local history when you run <code>git svn dcommit</code>. Instead you have to do the following:</p> <ol> <li><p>Fetch and rebase commits from Git repository:</p> <pre><code> $ git fetch origin $ git rebase origin/master (linearizes commits to svn) </code></pre></li> <li><p>Send the changes to SVN repository:</p> <pre><code> $ git svn rebase $ git svn dcommit </code></pre></li> <li><p>Push commits fetched from SVN back to origin:</p> <pre><code> $ git push -f origin master:master </code></pre></li> </ol> <p>The third step is extremely dangerous, it may result in a lost history. So, I don't recommend doing that — git-svn just does not support such workflow.</p> <p>Instead you may try <a href="http://subgit.com" rel="nofollow">SubGit</a>. SubGit is a bi-directional server-side mirror tool for SVN and Git repositories.</p> <p>If you have local access to Subversion repository, you can install SubGit into it:</p> <pre><code>$ subgit configure $SVN_REPOS # Adjust $SVN_REPOS/conf/subgit.conf to specify your branches and tags # Adjust $SVN_REPOS/conf/authors.txt to specify git &amp; svn authors mapping $ subgit install $SVN_REPOS ... $ INSTALLATION SUCCESSFUL </code></pre> <p>As result you get converted Git repository which is automatically synchronized with original SVN repository.</p> <p>If you have no local access to SVN repository, you may consider using SubGit 2.0 which is going to hit an early-access stage soon. SubGit 2.0 allows to setup bi-directional mirror between Git repository and remote SVN repository.</p> <p>SubGit is a commercial product. It is free for open-source and academic projects and also for projects with up to 10 committers.</p> <p>For more details please refer to <a href="http://subgit.com/documentation/" rel="nofollow">SubGit documentation</a> and <a href="http://subgit.com/documentation/gitsvn.html" rel="nofollow">git-svn</a> comparison page.</p> <p>Full disclosure: I'm one of SubGit developers.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload