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

Re: Question about "git pull --rebase"

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
Nov 14, 2009, 23:16 UTC
Message-ID
<20091115081649.6117@nanako3.lavabit.com>
In-Reply-To
<38b2ab8a0911141239w2bab7277o66350bc742d985dd@mail.gmail.com>
Quoting Francis Moreau <francis.moro@gmail.com>
> Let's say I'm on a branch called 'foo'.
> ...
>     $ git pull --rebase origin master:foo
With this command line, you are asking:
 1) Please first fetch master from origin and update the local 
    'foo' with it, but please fail if this doesn't fast forward;
 2) If the first step was successful, please rebase the current 
    branch on top of that commit.

If your current branch 'foo' doesn't fast forward, the first step should fail, and that is the failure you saw.

Your request doesn't make any sense. The first step would succeed only when your 'foo' doesn't have anything to replay on 'master' from origin, and the second step either isn't executed (when 'foo' has some commits), or it doesn't do anything (when 'foo' doesn't have any commit).

>     $ git pull --rebase origin master
With this command line, you are asking:
 1) Please first fetch master from origin, but don't store it anywhere;
 2) Then on top of that fetched commit, please rebase the current branch.
That is a much saner request.
-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Previous: Francis MoreauNext: Francis Moreau
Message 2 of 10 in “Question about "git pull --rebase"”
  1. Francis MoreauNov 14, 2009
  2. Nanako ShiraishiNov 14, 2009
  3. Francis MoreauNov 15, 2009
  4. Johan 't HartNov 14, 2009
  5. Francis MoreauNov 15, 2009
  6. Johan 't HartNov 15, 2009
  7. Junio C HamanoNov 15, 2009
  8. Johan 't HartNov 15, 2009
  9. Francis MoreauNov 16, 2009
  10. Francis MoreauNov 16, 2009

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.