git - How to push without the default --mirror option in a mirror repo -
for reason, must create mirror repo central repo.
central repo <-----> mirror repo <-----> dev repo
the risk pushing in mirror repo may overwrite histroy of central repo.
if (mr j) pushs new commit(commit_x) central repo , @ same time mirror going push without fetch, push overwrite histroy of central repo. result, commit_x deleted.
mr j need pull, merge , push commit_x again.
the rootcause if repo created clone --mirror, push implicitly use --mirror default not added after push.
i know possible install hook script disable push --mirror in centrol repo side.
but there way disable in mirror repo side?
[edit1] added illustration understanding question.

just edit .git/config , unset remote.<remote>.mirror, explained in git push:
--mirror
instead of naming each ref push, specifies refs under refs/ (which includes not limited refs/heads/, refs/remotes/, , refs/tags/) mirrored remote repository. newly created local refs pushed remote end, locally updated refs force updated on remote end, , deleted refs removed remote end. default if configuration option remote..mirror set.
Comments
Post a Comment