I've wondered about this as well.. Here are my thoughts:

   - I think it is healthy to keep features that are going to multiple 
   branches developed in features branches. Upon completion, the feature can 
   be merged to any branch where it is needed
   - The feature branches should be based on the common ancestor of the 
   branches it will be merged to (you can find this with git merge-base 
   master exp). I think this makes for the least possible friction when 
   merging to the various branches.

Aside from that, if we have some fixes that have gone directly into master 
branch, and we need these in the exp branch, I think the right thing to do 
is to merge master into the exp branch. It does feel a bit weird, but I 
asked around on the #git IRC channel, and they said there's no reason not 
to do so when needed.

I don't think it should be done too often though, as it does clutter the 
history a bit. "Merged latest changes from master" doesn't tell the reader 
much about what this commit was for.



On Friday, May 11, 2012 1:24:07 PM UTC+2, Nikos Chantziaras wrote:
>
> Hello.
>
> I'm a bit puzzled on how to best forward-port commits from a stable branch 
> ("master" in this case), to my experimental branch (let's call it "exp").  
> Both branches are pushed to a public repo.  Work that goes on in master 
> should be forward-ported to exp (I prefer forward-porting rather than 
> back-porting; that is, working on master and porting the commits to exp is 
> preferable to working on exp and porting the commits back to master.)
>
> What's the best way to deal with that?  Should I use rebase to apply the 
> commits from master to exp, or should I merge them?  I tried rebase in my 
> local repo (I pushed nothing to the public repo yet), but I'm not sure I 
> understand what's going on :-P  Yes, I've read Scott Chacon's awesome Git 
> tutorial, but it talks about rebasing local branches, that were never 
> pushed to a public repo, back to master.  My case is different; both 
> branches are on the public repo, while the commits made to master are not 
> yet pushed anywhere, and it's with those unpushed commits where I'm not 
> sure whether to merge or rebase to exp.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/M-gtkqW5tfMJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to