On 11/05/12 16:36, Konstantin Khomoutov wrote:
On Fri, 11 May 2012 04:24:07 -0700 (PDT)
Nikos Chantziaras<rea...@gmail.com>  wrote:

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 [...]

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? [...]

The consequence is that if you push a branch containing commits
(with C being the tip commit) to a public repo, then rebase these three
commits to produce
and push it again (this would require a forced push), everyone who
happened to fetch the original state of your branch and base their work
on it (on the commit C, that is) will have pain in the neck when their
next fetch from your repo will suddenly replace a series of tip commits
on that branch.  Everyone will be required to rebase their work in
turn, to follow your rebase.

I don't want to push something that would require others to rebase. But from the Pro Git book, in the "3.6 Rebasing" section, I had this in mind:

  Do not rebase commits that you have pushed to a public repository.
  If you follow that guideline, you’ll be fine.

And indeed the commits I'm talking about have *not* been pushed to a public repository; I just made those commits in master. So my first impression was that there would be no problem. But it seems I didn't understand what "rebase" really means. I now understand that when the book says "do not rebase pushed commits", it does not mean the commits I just made in master and want to rebase them to exp. It means all the commits in exp. Did I get that right now?

Btw, in case you're also using Mercurial, my workflow there is:

  * make a commit in master
  * "hg export" that commit
  * switch to the exp branch
  * "hg import" the commit

This would be "merge" in Git rather than "rebase", right?

You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to