Git-svn: how to copy git comes from one SVN branch to another?

I have a git-svn checkout of my entire repo (initialized in the standard way git svn init -t tags -b branches -T trunk $repo_url, then git svn fetched). I am by hand svn copy $repo_url/branches/branch1 $repo_url/branches/branch2. Then I ran git svn fetch, git checkout -b local-branch2 branch2took a few commits to branch2, dcommittook them back to the SVN repo, and I finished work on branch2. (Why a branch? I wanted to hack this branch locally in git, but still get back to SVN and get help from several employees when I worked on it).

What I have not done yet is to merge branch2back into branch1. If I am git checkout -b local-branch1 branch1, then git merge branch2it just quickly translates my pointer local-branch1to where branch2.

Instead, I want git to replay all the commits made since launch branch2to branch1 so that I can dcommit each one in the SVN repo. There seems to be a way to do this, but I can't think about it. Maybe, git rebaseor git cherry-pickevery fix made on branch2? (although the latter is a bit tiring). I would prefer not to combine the two URLs together, as was a big bucket of pain.

Ideas? Do any parts of this require more explanation?

+3
source share
1 answer

2, local-branch1, -, , branch2, ? git (, , ). sha1. local-branch1 git reset --hard branch2 && git rebase --onto local-branch1@{1} SHA1 ( SHA1 - sha1). , , 1. , , , git -svn-id: git - svn ( git -- script, , , ).

, ? , , git checkout local-branch1 && git merge --squash branch2 && git commit. , ( git -svn). , , . , svn .

+6

Source: https://habr.com/ru/post/1712337/


All Articles