Re: Commiting changes onto more than one branch
From: Mike Jarmy <hidden>
Date: 2016-06-15 22:47:46
On Wed, Nov 25, 2009 at 11:38 AM, Eugene Sajine [off-list ref] wrote:
quoted
Suppose that I checkout the v3 branch, and fix the bug by editing several different files. (Lets assume for now that the files in question have not diverged between any of the 3 branches, even though tons of other files have changed). How do I commit the bugfix into all of v3, v4 and v5? Clearly, merging the branches together would be bad. So I think what I should do is perform 3 different commits, but I'm not quite sure how to juggle the git index (or stash or whatever) to accomplish this. This may be a really obvious question, but I'm a confused git newbie.It as not as clear for me why you think merge will be bad? If you commit your changes to the v3, then merging to v4 and v5 (which are not changed) should be very simple fast forward merge. Which means just move the pointer to the last commit from v3 Am i missing something?
I guess I didn't explain it too well, I made it sound like v3, v4 and v5 were still more-or-less the same. What I'm thinking about here is a case where we have switched to git a while back, and then done a lot of work on the various different branches, so that v3, v4 and v5 have diverged very far from each other. In that case, we would never want to merge them together.