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.

enter image description here

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

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -