This is how to set up a remote git repository (a mirror) simply via ssh.
It assumes you have a server set up with SSH, and that you have sudo access to it.
sudo adduser git).
/var/repos/gitowned by the
.ssh/authorized_keysfile, so you can SSH as that user.
myrepo, create a directory
/var/repos/git/myrepo.gitowned by the
gituser, in that new directory, run
git init --bare.
git add remote myremotename git@myserver:/var/repos/git/myrepo.git
git push -u myremotename main(or whatever your main branch is)
There, now you have a remote mirror on a server you control.