Re: `git fetch` not updating 'origin/HEAD' after branch rename

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 13, 2021 at 5:18 PM Sam Bostock <sam.bostock@xxxxxxxxxxx> wrote:
> Long story short, it seems to me that `git fetch` should update
> "refs/remotes/origin/HEAD" when the upstream HEAD changes, but it
> doesn't.

It's never been the *intent* to have `git fetch` update
the corresponding remote-tracking `HEAD` ref.  To make
that happen, you must run `git remote`:

    git remote set-head origin -a

for instance.

I have, however, often thought that this is the wrong
*default* way for things to work, and that at least by default,
`git fetch origin` should update `origin/HEAD` if the
fetch result indicates that it should.  See also Junio's
reply.  I think a configuration knob (similar to `fetch.prune`)
would be reasonable here.  Users could then be encouraged
to set `fetch.prune` to `true`, and `fetch.update-remote-HEAD`
(or whatever) to `true` as well.

Chris



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux