0

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).

yasouser
  • 5,113
  • 2
  • 27
  • 41
  • 1
    kind of duplicate of http://stackoverflow.com/questions/2490794/git-svn-create-push-a-new-branch-tag, no? – VonC Sep 28 '10 at 20:41
  • kind of similar but the difference is in the detail I missed out. When the original clone was created I did not do the shallow copy using the -s flag. I just cloned the trunk. Because of this the config file does not have any clue about the Branches/Tags. – yasouser Sep 28 '10 at 22:46
  • I could only think of a round about solution: 1) do another clone with the -s flag. 2) Follow the steps outlined here: http://trac.parrot.org/parrot/wiki/git-svn-tutorial#TrackingSVNbrancheswithGIT. – yasouser Sep 28 '10 at 22:47

1 Answers1

2

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
  • 488
  • 3
  • 15