The following method only syncs from GitLab to GitHub!
- Create GitLab Repo and push content
- Create GitHub Repo
- Copy SSH link of GitHub Repo
- Go to GitLab Repo Settings -> Repository
- Expand "Mirroring repositories"
- Paste SSH link in the URL field.
- Add "ssh://" in the beginning
- Change the column (:) between github.com and username to slash (/)
- Click "Detect Host Keys"
- Select "SSH public key" as authentication method
- Click "Mirror repository"
- Copy SSH public key
- Go to GitHub Repo Settings -> Deploy Key
- Click "Add deploy key" (top right)
- Enter a name like "GitLab Sync"
- Paste the SSH public key
- Allow write access
- Click "Add key"
- Synchronization is not executed immediately. Wait a bit.