LinPan, This is a tough one. Initially your best bet to to either cherry-pick the commits you want into master, or use `git-rebase -i` to rebase onto master and remove the commits you don't want.
In the future you can avoid this by not working directly off the stable branch. Instead branch off of master, do your changes, and merge the branch into stable when it's ready. In the future you can then merge the branch directly into master, never touching the stable branch. If the change you're making depends on another branch, you would branch off of that point instead of master. In short, always work in a branch, always branch off of master or a branch that branched off of master, and only perform merges in master and staged, never commit directly to them. Another approach you can take is to work off of stable in a branch, and rebase it onto master when you're done, then merge back into stable. Lets say you have a branch named "randomfix" that you started off the branch "stable"... > git rebase --onto master stable randomfix > git checkout stable > git merge randomfix > That will take all changes from stable through randomfix (not including the commit stable points to) and rebase them onto master, then merge that branch into stable. You may of course run into conflicts during the rebase and merge, which usually mean that you shouldn't be rebasing onto master, but rather onto a branch that has bee merged into stable but not master. I usually go for the first approach, branching directly off master, unless there are changes not in master that I need. In those cases I branch off the branch with the changes I need, or branch off master and merge in the branches I need. --tek On Wed, Oct 8, 2008 at 2:35 PM, LinPan <[EMAIL PROTECTED]> wrote: > > Scenario: I have two branches, master and stable. Stable has updates > that I don't want in master at this point. Then I create a new branch > off of stable to do some fixes. When I'm done making updates to the > new branch, I can easily add the fixes back into stable with a merge. > But for master, I would just like to merge in the updates made to the > branch since it was created. How do I go about merging in just the > modifications made to the new branch without merging in the old > alterations from the stable branch, which the new branch was based on? > > --linpan > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "GitHub" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/github?hl=en -~----------~----~----~----~------~----~------~--~---
