How to synchronize the contents of local Gitlaba repositories with Github?
For example, to add a commit to Gitlab the same thing appeared in Github.
How to synchronize the contents of local Gitlaba repositories with Github?
For example, to add a commit to Gitlab the same thing appeared in Github.
if the server with gitlab is under your control, then you can create a post-commit hook in the repository, which will be called when commits enter this repository. revised and updated example :
on behalf of the user under which gitlab runs , generate a private-public key pair:
$ sudo -u пользователь ssh-keygen id_rsa.pub file in the .ssh in the user's home directory) to the keys of your account on github .in the directory with the repository on the server with gitlab- th on behalf of the same user, add a new remote with an arbitrary name (for example, togithub ):
$ sudo -u пользователь git remote add --mirror=push togithub url-репозитория-на-github-е in the same directory in the hooks subdirectory, create a file called post-commit the following content:
#!/bin/sh exec git push togithub -f --mirror and set it executable bits:
$ sudo chmod +x hooks/post-commit Source: https://ru.stackoverflow.com/questions/382773/
All Articles