GitLab Developer FAQ: Difference between revisions

From pCT
No edit summary
No edit summary
Line 26: Line 26:
* Keep in mind: the token is only visible in the web interface after creation, you can not get it later
* Keep in mind: the token is only visible in the web interface after creation, you can not get it later
* Unused tokens should be revoked as soon as possible
* Unused tokens should be revoked as soon as possible
== Create repository clone ==
A '''repository clone''' is your work copy, it is created using the <code>git clone</code>-command.
Find the links for the repository to be cloned
[[File:Pct-online-clone-button.png|300px]]
=== Clone using SSH ===
An SSH key needs to be configured -> [[Gitlab Developer FAQ#Register SSH key]]
  git clone git@git.app.uib.no:pct/pct-online.git
'''Note:''' this is an example for the <code>pct-online</code> repository
=== Clone using Access Token ===
An access token needs to be configured -> [[Gitlab Developer FAQ#Create access token]]
    git clone https://gitlab-ci-token:your-token-number@git.app.uib.no/pct/pct-online
'''Note:'''  insert <span style="color:yellow; background:red; bold"> ''your token number''</span>

Revision as of 20:21, 9 February 2021

Main Page -> Documentation -> Gitlab Developer FAQ

This is a collection of frequently asked Gitlab questions for developers

Please edit this page and add your question, or send email to pCT@uib.no

Authentication

In order to clone non-public repositories and do synchronization, an authentication method is required. It is recommended to use SSH keys

Register SSH key

  1. Login to https://git.app.uib.no
  2. go to User settings -> SSH Keys (https://git.app.uib.no/-/profile/keys)
  3. paste public SSH key from your .ssh folder, something like id_*.pub
  4. select optionally a title and expiration date
  5. click Add

Create access token

  1. Login to https://git.app.uib.no
  2. go to User settings -> Access Tokens (https://git.app.uib.no/-/profile/personal_access_tokens)
  3. Choose name and expiration date and scopes
  4. click Create personal access token
  5. Store the token in a safe place or configure the relevant application for accessing the repository with this token immediately

Hints:

  • Create access tokens only for the scope with the minimal access permissions required for your purpose
  • Keep in mind: the token is only visible in the web interface after creation, you can not get it later
  • Unused tokens should be revoked as soon as possible

Create repository clone

A repository clone is your work copy, it is created using the git clone-command.

Find the links for the repository to be cloned

Pct-online-clone-button.png

Clone using SSH

An SSH key needs to be configured -> Gitlab Developer FAQ#Register SSH key

  git clone git@git.app.uib.no:pct/pct-online.git

Note: this is an example for the pct-online repository

Clone using Access Token

An access token needs to be configured -> Gitlab Developer FAQ#Create access token

   git clone https://gitlab-ci-token:your-token-number@git.app.uib.no/pct/pct-online

Note: insert your token number