Versions Compared

Key

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


Info
titleShort info

If you have your project on another code management platforms, you will learn how you can always have a fresh copy of your project also on GitLab

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

...

pull mirror from GitHub to GitLab

...

Create a GitHub personal access token

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

...

On the left sidebar, select Settings > Repository

...

Tip

In all the points below, GitLab is just an example.
You might as well use GForge, Bitbucket or any other Gitlab to clone your project.

Clone repo and push changes - set mirror repository

  1. Open your command line terminal
  2. Clone the repository from GitHub 

    Code Block
    git clone --bare https://github.com/GROUPNAME/PROJECTNAME.git


  3. Push mirror to ACH GitLab

    Code Block
    git push --mirror https://

Enter a Git repository URL

Tip

Enter a Git repository URL with this format: https://<your_github_username>@github.com/<github_group>/<github_project>.git

...

Select Mirror repository

Info

The mirrored repository is listed. For example:

Image Removed

How to synchronize with GitHub?

  1. Make some code changes on GitLab and commit it
  2. Log in to
    gitlab.eufus.psnc.pl
    /GROUPNAME/NEW-PROJECTNAME.git


  3. Use GitLab credentials to access and update mirror repository

    Image Added

Refresh changes and push to GitLab - update mirror repository

  1. Open your command line terminal and go to cloned repository
  2. Fetch changes and push mirror to ACH GitLab

    Code Block
    git fetch origin "+refs/heads/*:refs/heads/*" --prune
    git push --mirror https://gitlab.eufus.psnc.pl/GROUPNAME/NEW-PROJECTNAME.git


  3. Use GitLab credentials to access and update mirror repository

    Image Added

  4. On the top bar, select Menu > Projects and find your project
  5. On the left sidebar, select Settings > Repository

  6. Expand Mirroring repositories
  7. And click refresh button Udpdate now
    Image Removed

    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