Search code examples
gitsvngit-svnrebase

git svn rebase conflicts


Hi we are doing one way synchronisation from svn to git. We are following some steps by searching through the internet. Developers commit code to the svn. We need to synch all the changes to Git from svn. No one commits to git and the git branch is empty initially. We are using git-svn to do this process.

the steps are:

1) git svn clone

2) git add remote origin

3) git pull

4) git push

Upto here everything is fine and no issues.

Now we want to push the new changes from svn to git. Then we do

git svn rebase

it is showing conflicts. We don't want to do resolve conflicts manually. Whatever committed to svn should be pushed to git. Please help us is there any other way that it can push changes from svn to git without conflicts means auto merge from svn because we want to do this process automate.

And also if there are any particular steps do we need to follow to work the sync without any conflicts.

Thank You.


Solution

  • In case you are ready to completely ignore whatever happens on the git side, you could do the following sequence:

    fetch latest from svn

    git svn fetch
    

    assuming you want to push svn/trunk to origin/master

    -f forces the current state of svn/trunk to override whatever sits at the remote side

    git push -f origin svn/trunk:master