git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Re: Why the default action for pull is merge, but not rebase?

From
ESEugene Sajine <euguess@gmail.com>
Date
Oct 27, 2010, 17:58 UTC
Message-ID
<AANLkTinDaYr8fsZiit4VYH-vptO7LtwRggkFGLKMnAhY@mail.gmail.com>
In-Reply-To
<0016e645b8c87a160804939cdc5e@google.com>
On Wed, Oct 27, 2010 at 1:50 PM,  <Euguess@gmail.com> wrote:
Show 74 quoted lines
> On Oct 27, 2010 1:36pm, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Eugene Sajine wrote:
>>
>>
>>
>> > 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.
>>
>
> Oh, I see. In this case you're right.
> My scenario is probably making more sense for the "centralized approach",
> where the exchange goes via some blessed bare repo on the server.
> So, I just have to run git pull --rebase to get my scenario working, right?
>
>
> Thanks!
> Eugene

Actually it seems that it will not work as i would expect... git pull --rebase is going to rebase the upstream on top of my local branch, right? Is this really intended behavior? Shouldn't it rebase my local on top of the upstream instead?

Thanks, Eugene

Previous: Björn SteinbrinkNext: Jonathan Nieder
Message 6 of 13 in “Why the default action for pull is merge, but not rebase?”
  1. Eugene SajineOct 27, 2010
  2. Jonathan NiederOct 27, 2010
  3. Eugene SajineOct 27, 2010
  4. Jonathan NiederOct 27, 2010
  5. Björn SteinbrinkOct 28, 2010
  6. Eugene SajineOct 27, 2010
  7. Jonathan NiederOct 27, 2010
  8. Eric RaibleOct 27, 2010
  9. Joshua JensenOct 28, 2010
  10. Kevin BallardOct 28, 2010
  11. Eric RaibleOct 28, 2010
  12. Kevin BallardOct 28, 2010
  13. Stefan HallerOct 28, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.