"Bence Ferdinandy" <bence@xxxxxxxxxxxxxx> writes: > I think the correct way to handle this would be to check if the remote has > `mirror=true` set, and if we're running in a bare repository we should overwrite > HEAD and if it's not a mirror we should instead set up > `refs/remotes/nonmirrorremote/HEAD`. (I think a remote can be a mirror without > the repository being bare, I'm not sure.) A non-bare repository can technically be a mirror but such a thing is only useful when (1) it never fetches from anywhere afterwards, (2) it stays on a branch that never changes by convention, or (3) it stays on a detached HEAD. Otherwise "git fetch" in it would almost always fail. Practically (1) and (2) are not all that useful---such a static checkout does not even have to be a Git repository but a tarball extract. If you overwrite HEAD upon fetch, you will render the last remaining useful usage, (3), also useless. Thanks.