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

Re: Question about "git pull --rebase"

From
FMFrancis Moreau <francis.moro@gmail.com>
Date
Nov 16, 2009, 12:17 UTC
Message-ID
<38b2ab8a0911160417w6b9cc943h5e87d4e22d0dea2b@mail.gmail.com>
In-Reply-To
<4AFF3D4D.7000308@gmail.com>
On Sun, Nov 15, 2009 at 12:29 AM, Johan 't Hart <johanthart@gmail.com> wrote:
Show 9 quoted lines
> This does not update any remote tracking branches, but it will rebase your
> foo branch on the remote master branch (which is what you want)
> It could also be done with:
>
> git pull --rebase origin master:origin/master
>
> This will also update your remote tracking branch refs/remotes/origin/master
> to match the master branch on the remote repo. Your foo branch will then be
> rebased onto it.
BTW, this seems to be not exact.
$ git pull --rebase origin master:origin/master

fetches the 'master' branch on the remote repo, then creates a new branch 'origin/master', which is updated with the fetched branch.

To update the remote tracking branch refs/remotes/origin/master, I need to issue:

$ git pull --rebase origin master:remotes/origin/master

BTW2, it looks like if the <dst> local ref doesn't exist the it will be created. This something that appears very lately in the man page (actually I can see the information only in the last example). This could be part of the <refspec> defintion.

Thanks
-- 
Francis
Previous: Francis Moreau
Message 10 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.