...
- Create or select origin repository, in this case it was ITER git repository
Clone origin repository with --
mirror
flag:Code Block git clone --mirror ssh://git@git.iter.org/imex/gittest.git
Change directory to newly cloned mirror repository:
Code Block cd gittest.git
Push mirrored repository to new origin with
--mirror
flag:Code Block git push --mirror git@gitlab.eufus.psnc.pl:ach/gittest.git
Info title Warning! Don’t use
git push --mirror
in repositories that weren’t cloned by--mirror
as well. It’ll overwrite the remote repository with your local references (and your local branches). This is not what we want. Read the next section to discover what to do in these cases.