Why does Git Push --mirror require a non detached head?

123 Views Asked by At

I've noticed that git push --mirror requires a proper repository state. This doesn't make sense to me , since mirroring all references should be able to occur regardless of where the HEAD is pointed at. Any thoughts on how to make git push --mirror work on any sort of repository ? I find that currently, I have to do something like

git pull

git checkout master

git push --mirror secondrepo

Which "feels" like its overkill given the simple and transparent branching model that git follows. It seems like mirror pushes should be doable from any repository state.

0

There are 0 best solutions below