Re: Fetch remote only if remote hasn't been fetched recently
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 9, 2025, 14:08 UTC
- Message-ID
- <xmqqtt4puhwq.fsf@gitster.g>
- In-Reply-To
- <CAGJzqsksmQmY4o-_7DoPFK8VP-h59ANUjroVv2+++ZG3gDBdUA@mail.gmail.com>
M Hickford <mirth.hickford@gmail.com> writes:
Show 5 quoted lines
> 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/*'