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.
git
user (sudo adduser git
)./var/repos/git
owned by the git
user.git
user's .ssh/authorized_keys
file, so you can SSH as that user.myrepo
, create a directory /var/repos/git/myrepo.git
owned by the git
user.git
user, 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.