Re: Why the default action for pull is merge, but not rebase?
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Oct 27, 2010, 17:36 UTC
- Message-ID
- <20101027173644.GB15657@burratino>
- In-Reply-To
- <AANLkTimoSH2C4dBDDN1KMaFAp_nwAtLy5_uNFfiuz5GR@mail.gmail.com>
Eugene Sajine wrote:
Show 11 quoted lines
> Thanks for prompt answer. But let me clarify: > > When you do pull git performs: > > fetch of the remote branch to the FETCH_HEAD > and then merge of FETCH_HEAD into the local branch > > What I'm saying is that your local branch should be rebased on top of > FETCH_HEAD instead > > In this case there is no such thing as "often rebased public branch".
Ah, but there is.
Imagine you are Junio and just received a pull request from Pat. Then you might try:
$ git pull pat for-junio
which will do all the fetching and merging magic that "git pull" is known for. Now if pat's for-junio branch is based on the tip of your current branch, this will be a fast-forward and it doesn't matter whether you merge or rebase. But what if there are some intervening commits?
$ git pull eric for-junio $ git pull pat for-junio
If this pull were the rebasing kind, the result would be for Eric's commits to be rewritten based on Pat's.