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

Re: Fetch remote only if remote hasn't been fetched recently

From
M Hickford <mirth.hickford@gmail.com>
Date
Jun 11, 2025, 07:00 UTC
Message-ID
<CAGJzqs=Xur+=0=KUSR6TQA-A3zt-Bpyd5-T52_ntuV+mCUrAQA@mail.gmail.com>
In-Reply-To
<xmqqtt4puhwq.fsf@gitster.g>
On Mon, 9 Jun 2025 at 15:08, Junio C Hamano <gitster@pobox.com> wrote:
Show 17 quoted lines
>
> M Hickford <mirth.hickford@gmail.com> writes:
>
> > Interesting, thank you.
> >
> > Suppose my network connection is intermittent. While the machine is
> > online, `git fetch --prefetch` runs successfully. Later I am offline.
> > How can I complete the fetch?
>
> I _think_ that it uses "git fetch --prefetch" to store what is
> usually stored at refs/$R to refs/prefetch/$R (so your
> remote-tracking branch refs/remotes/origin/frotz is stored at
> refs/prefetch/remotes/origin/frotz instead), so I would presume that
> it should be the matter of doing something silly like this:
>
>     $ git fetch . 'refs/prefetch/remotes/origin/*:refs/remotes/origin/*'
>
Thanks, that worked.

To support Git users with sporadic connectivity, might it be useful to add an option to git fetch? Perhaps `git fetch --offline` or `git fetch --complete-prefetch`?

https://git-scm.com/docs/git-fetch
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 8 in “Fetch remote only if remote hasn't been fetched recently”
  1. M HickfordJun 5, 2025
  2. Konstantin RyabitsevJun 5, 2025
  3. Junio C HamanoJun 5, 2025
  4. M HickfordJun 7, 2025
  5. Junio C HamanoJun 9, 2025
  6. M HickfordJun 11, 2025
  7. Junio C HamanoJun 11, 2025
  8. M HickfordJul 1, 2025

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.