So I'm using git and interacting with an svn repo.
I have a svn TRUNK that looks like this:
A-B-C-D
And a svn bug_fixes branch that branches off at commit B or C:
-c-d-e-f-g-h-i
Now I need to get the cdefghi commits that are in my svn branch back into the master branch.
I'm aware that I could just do a squashed commit, let's call it squash SQUASH (which would contain cdefghi), but then it seems like I would have to kill the bug_fixes branch and start a new branch to cleanly continue.
Here: http://blog.red-bean.com/sussman/?p=92 they suggest:
checkout
the branch.
merge
master's changes into the branch.
Checkout
the master.
merge --reintegrate
the branch's changes onto master.
Continue development.
Unfortunately, git-svn doesn't seem to recognize any "merge --reintegrate" command for svn.
So how do I cleanly make branch and master have all commits, so that development on both can continue, using git-svn's commands?
Would this not be a good case for rebasing your local stuff (
<branchpoint>..i
) onto the new master fetched from SVN?If you dcommit a merge it automatically squashes it into 1 commit. Sadly it does not internally use svn:mergeinfo or --reintegrate as it should, so you lose the association with the branch created via 'git svn branch'.
Ok, so a few approaches that I found:
or
or
And then after all that.
Then (from svn because git-svn doesn't support deletion) delete the branch, and recreate it from trunk and start the cycle all over again.
The Caveats section of the
git-svn
documentation warnsThe author does provide a recommendation:
Adapting to your situation
where
c
andi
are appropriate identifiers for the commits in your history.What you also can do is cherry-pick, provided that you wouldn't use merge.
Both statements should be done on the branch without the changes.
Provided that c is older than i and that you want to take the whole sequence.
Or separate commits