开发者

How to create a svn branch from local git branch?

开发者 https://www.devze.com 2023-01-18 12:26 出处:网络
I am 开发者_开发技巧using git version 1.7.2.3 and I have the following situation: Clone git repo from svn

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消