Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
titleShort 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

Before you can proceed with the setup of mirror, you have to create personal access token:

Set up a push mirror on gitlab.eufus.psnc.pl

  1. Log in to gitlab.eufus.psnc.pl
  2. On the top bar, select Menu > Projects and find your project
  3. On the left sidebar, select Settings > Repository

  4. Expand Mirroring repositories
  5. Enter a Git repository URL

    Tip

    Enter a Git repository URL with this format:


  6. For Password, enter your GitHub personal access token

    Image Added
  7. Select Mirror repository


    Info

    The mirrored repository is listed. For example:

    Image Added


How to synchronise with GitHub?

  1. Make some code changes on GitLab and commit it
  2. Log in to gitlab.eufus.psnc.pl
  3. On the top bar, select Menu > Projects and find your project
  4. On the left sidebar, select Settings > Repository

  5. Expand Mirroring repositories
  6. And click refresh button Udpdate now
    Image Added


    Info

    Such information should appear on the website:

    "The remote repository is being updated..."


  7. Check your repository on github. Changes should be already pushed from ACH GitLab

How to synchronise ITER repository with Gitlab?

Info
titleSynchronise with hoos

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

  1. Check the push permissions in Settings > Repository > Protected Branches (by default "Maintainer") 
  2. 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.
  1. Fill in the screen below:

Image Added

  • 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. a full mirror 
  • Keep all boxes ticked