Info | ||
---|---|---|
| ||
This article will tell you how to easily share your GitLab project (as a mirror) with other code management platforms. |
Table of Contents |
---|
Info |
---|
Throughout this tutorial we are using public repository at following location: https://github.com/mkopsnc/beaver. However, you can use any other repository. |
Set up a push mirror from GitLab to GitHub
Create personal access token Anchor Creating personal token Creating personal token
Creating personal token | |
Creating personal token |
Before you can proceed with the setup of mirror, you have to create personal access token:
- Github - how to create personal access token at Github
- Gitlab - how to create personal access token at Gitlab
- Bitbucket - how to create personal access token at Bitbucket
Set up a push mirror on gitlab.eufus.psnc.pl
- Log in to gitlab.eufus.psnc.pl
- On the top bar, select Menu > Projects and find your project
On the left sidebar, select Settings > Repository
- Expand Mirroring repositories
Enter a Git repository URL
Tip Enter a Git repository URL with this format:
If you have Github repo - https://<your_github_username>@github.com/<github_group>/<github_project>.git
If you have Gitlab repo - https://<your_gitlab_username>@gitlab.com/<gitlab_group>/<gitlab_project>.git
If you have Bitbucket repo - https://<your_bitbucket_username>@bitbucket.com/<bitbucket_group>/<bitbucket_project>.git
- For Password, enter your GitHub personal access token
Select Mirror repository
Info The mirrored repository is listed. For example:
How to synchronise with GitHub?
- Make some code changes on GitLab and commit it
- Log in to gitlab.eufus.psnc.pl
- On the top bar, select Menu > Projects and find your project
On the left sidebar, select Settings > Repository
- Expand Mirroring repositories
And click refresh button Udpdate now
Info Such information should appear on the website:
"The remote repository is being updated..."
- Check your repository on github. Changes should be already pushed from ACH GitLab
How to synchronise ITER repository with Gitlab?
Info | ||
---|---|---|
| ||
Special thanks goes to Karel van de Plassche for providing these steps |
Push plugin at ITER is based on: https://github.com/ef-labs/stash-hook-mirror/wiki
- Check the push permissions in
Settings > Repository > Protected Branches (by default "Maintainer")
- Create a Project Access Token in
Settings > Access Tokens
. I've given it full permissions (everything ticked). Also put the expiry time on something sane (by default 4 weeks - I just put infinite) and put the role to the permissions of step 1.
- Fill in the screen below:
- Mirror Repo Url needs to be HTTPS, e.g.
https://gitlab.eufus.psnc.pl/imas/imaspy.git
- Username can be anything, as we're using tokens
- Password the token generated in step 2
Refspec
can be the default; this brings expected behaviour, e.g. afull mirror
- Keep all boxes ticked
The scientific work is published for the realization of the international project co-financed by Polish Ministry of Science and Higher Education in 2019 from financial resources of the program entitled "PMW"; Agreement No. 5040/H2020/Euratom/2019/2
This work has been carried out within the framework of the EUROfusion Consortium and has received funding from the Euratom research and training programme 2014–2020 under grant agreement No 633053. The views and opinions expressed herein do not necessarily reflect those of the European Commission or ITER