How To Clone a GitLab Project Repository


Prerequisites

  • Make sure you have the access to GitLab: check that you are able to login to https://gitlab.pricefx.eu (either by username and password or via Azure Single Sign-On in case you have @pricefx.com email address)

  • SourceTree installed (alternatively you can use any other GIT client such as IntelliJ IDEA, Git command line, etc.)

Create GitLab Token

Due to security reasons, authentication using username and password is not allowed from the clients. Instead, you will need a GitLab token. If do not have one yet, create it by following these steps:

  1. Log in to GitLab

    Screenshot 2020-04-24 at 11.00.23.png


  2. Check you GitLab username. Then go to your settings:

    Screenshot 2020-04-24 at 10.59.08.png


  3. Select Access tokens:

    Screenshot 2020-04-24 at 11.01.28.png


  4. Create a new token, give it a name, e.g. Studio and add the following scopes:

    • read_repository – mandatory

    • write_repository – mandatory

    • read_user – if you will add an account to SourceTree (recommended)

    • read_api – if you will want to allow SourceTree to list all projects (recommended)

      Create GitLab token.png


  5. Store your personal token safely, ideally in your favorite password manager, since it is used instead of a password and can reuse it for all Gitlab projects.

    Screenshot 2020-04-24 at 11.03.14.png

Set up GitLab Account in SourceTree

Windows

  1. Navigate to Tools > Options > Authentication > Add.

  2. Select host “GitLab CE” and paste this https://gitlab.pricefx.eu as Host URL.

  3. Select protocol “HTTPS” in URLs in examples in this guide

  4. Click “Refresh Personal Access Token” and use the created token as a password.

  5. Click Save.

image-20200526-160324.png

Mac

  1. Navigate to SourceTree > Settings > Accounts > Add.

  2. Select host “GitLab CE” and paste this URL https://gitlab.pricefx.eu next to it.

  3. Select the protocol to be “HTTPS” instead of “SSH”.

  4. Fill in your username and use the created token as a password.

Screen Shot 2020-05-30 at 11.38.26.png

Clone the repository

Windows

  1. Click Clone tab > and paste the URL of repo. You may want to change the “Destination path” to something like “C:\Users\myusername\pricefx\sandbox-logic” and click Clone.

Clone repo Win.png


Mac

  1. Click New > Clone From URL > and paste the URL of repo. You may want to change the “Destination path” to something like “/Users/myusername/pricefx/sandbox-logic” and click Clone.

Clone repo Mac.png