References:
ITER git repository: https://git.iter.org/projects/IMEX/repos/gittest/browse
ACH gitlab repository: https://gitlab.eufus.psnc.pl/ach/gittest
- Create or select origin repository, in this case it was ITER git repository
Clone origin repository with --
mirror
flag:git clone --mirror ssh://git@git.iter.org/imex/gittest.git
Change directory to newly cloned mirror repository:
cd gittest.git
Push mirrored repository to new origin with
--mirror
flag:git push --mirror git@gitlab.eufus.psnc.pl:ach/gittest.git
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.