views:

29

answers:

1

I am using git version 1.7.2.3 and I have the following situation:

  Clone git repo from svn
  |
  *
  * (<= commits to master & corresponding commit to svn)
  *
  *
  |
  master (points to svn HEAD)
  |
  |___ my-branch (no equivalent svn branch)
        |
        *
        * (multiple commits to this branch)
        *
        *
        |
        (Current head of my-branch)

I would like to know how to push the "Current head of my-branch" branch in git on to svn (where it doesn't exist yet).

+1  A: 

I would advise to just check out the subversion repository again this time with the previously omitted -s flag. First create a patch on your already set up git repo:

$ git checkout my-branch
$ git format-patch master --stdout > my_branch.patch

Then apply the patch (git apply) on your newly created git repository which is aware of the tags and branches directory of subversion. For that git svn branch will do the job.

gilligan
Instead of a manual merge, the patch would have worked easily. Thanks for your answer.
anand.arumug