GitLab/Mirroring projects
< GitLab
Please do not mark this page for translation yet. It is still being drafted, or it contains incomplete translation markup which should be fixed before marking for translation. |
Mirroring to GitHub
editPreparations
edit- Create a target repo on GitHub, if you haven't already. This can be done by importing the gitlab.wikimedia.org repo.
- Create a personal access token in GitHub. This is done on https://github.com/settings/tokens?type=beta. Add permission "Contents" -> "Access: Read and write".
Set up push mirror
edit- In the repo view in gitlab.wikimedia.org go to "Settings" (bottom in the left hand menu) -> "Repository".
- Expand "Mirroring repositories".
- Enter the HTTPS URL of the GitHub repo, same as the clone URL, but include username, i.e. https://username@github.com/....git.
- Leave "Mirror direction", you can't change it anyway unless you have proprietary GitLab EE license.
- Select "Password" for "Authentication method".
- In "Password" enter the personal access token from your GitHub account.
- Click "Mirror repository". You should get a message at the top of the page saying it worked.
Test configuration
edit- Make a commit in the Gitlab repo.
- Click the circular arrows ("Update now") to start an update. If it goes through changes should be pushed to the GitHub repo.
If your personal access token on GitHub expires you need to add a new mirroring (after you've regenerated the token). There doesn't seem to be a way to just update the token.