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

Re: Git pull without fetch

From
ronan@rjp.ie <ronan@rjp.ie>
Date
Feb 18, 2023, 02:02 UTC
Message-ID
<fc7d9fdde0443532eb9c32f26f9f054e@rjp.ie>
In-Reply-To
<CAPx1Gvd8vizeyveKgE2o2GStQsiGxN4aaASqYc81Nk28ogFLJg@mail.gmail.com>
February 17, 2023 6:46 PM, "Chris Torek" <chris.torek@gmail.com> wrote:
> `git pull` = `git fetch` followed by a second command, either `git merge` or `git rebase`. If you
> don't want the `git fetch` step, run the *second* command, instead of running *both* commands: it's
> really just that simple.

No it isn't. Sorry, but I think you have misunderstood the problem. I'm well aware of the behavior of git pull.

In the scenario described, `git rebase` will always report "Already up to date" because the head of the current branch and the head of the remote tracking branch are the same. The prefetched reference lives under refs/prefetch/* and is unnoticed by git rebase. This is why I used `git update-ref ...` first: to update the remote tracking branch from the prefetched copy.

Previous: ronan@rjp.ieNext: Junio C Hamano
Message 2 of 4 in “Git pull without fetch”
  1. ronan@rjp.ieFeb 18, 2023
  2. ronan@rjp.ieFeb 18, 2023
  3. Junio C HamanoFeb 18, 2023
  4. ronan@rjp.ieFeb 18, 2023

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.