Then set up the alternative remote on your repos.
[1]https://www.linux.com/training-tutorials/how-run-your-own-gi...
ssh [email protected]
mkdir project-1.git
cd project-1.git
git init —-bare
exit
git remote add alternate [email protected]:project-1.git
All you need is SSH git clone --mirror https://github.com/you/repo
Push those to another server: git remote add new https://gitlab.com/you/repo
git push --mirror newHowever git has more: - Bug tickets - PR - Wiki - many projects use their githubpages as primary homepage - newly GitHub actions
And then: Often collaborators are only known and identified by their GitHub handle. Running an own server requires some mechanism to identify them again and creating a way to handle their access credentials (ssh key etc.)
Moving a mildly successful project isn't easy. Good if more people plan for that eventuality, even if they stay on GH for the time being.
git remote set-url --add origin [email protected]:my-project
This will make it so that every time you push to "origin", it'll push twice, to two places. You can repeat this to add a third or more.Building this in git itself is not hard at all, and there's likely a script or plugin for gogs or gitea.
But GitLab does have feature support for extensive importing and mirroring. https://docs.gitlab.com/ee/user/project/import/github.html (Import your project from GitHub to GitLab) has a section on project mirroring.
git add remote NAME URL
git push NAME
It will not transfer GitHub specific content (issues, PE, wiki, etc.), though.git remote add originFoo URL
git push --all originFoo
There are other flags like mirror but never used them.
Ideally, I'd like to have two synchronized repositories, for no single point of failure, organizational or otherwise.