User Tools

Site Tools


auth_gitlab

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
auth_gitlab [2019/12/03 14:23] – [GitLab] apanoauth_gitlab [2019/12/03 14:57] – [Local Configuration] apano
Line 23: Line 23:
  
 ===== Identify or create the SSH key ===== ===== Identify or create the SSH key =====
-If you need support on how to generate the SSH key follow our guide on [[auth:howto:sshkeygitlab|How to create an SSH Key for GITLAB]]. + 
 +You need an SSH key that resides on your workstation/notebook. 
 + 
 +==== Check for an existing SSH key ==== 
 + 
 +If you already have an SSH key you will probably find it here: 
 + 
 +Linux/macOS :      ~/.ssh/id_rsa.pub 
 + 
 +Windows :          %userprofile%\.ssh\id_rsa.pub 
 + 
 + 
 +Open the file with a text editor and check if it has contents. Typically it starts with ssh-rsa or ssh-ed25519. If it has contents [[auth:gitlab#add_an_ssh_key|add it to Gitlab]] if it does not exist or is empty generate an SSH key. 
 + 
 +==== Generate an SSH key ==== 
 +Open a terminal on Linux or macOS, or Git Bash on Windows and run the command: 
 +<code>ssh-keygen -t rsa -C "your@email" -b 4096</code> 
 +or 
 +<code>ssh-keygen -t ed25519 -C "your@email"</code> 
 + 
 +You can check your e-mail on your Gitlab Profile -> Main Settings -> Email 
 + 
 +When you are asked for a location and file name you can either keep the default location or choose a new one. If this is your only key we advice you accept the defaults and maintain the file name id_rsa. Should you have several keys you can name them according to your own preferences. [[https://docs.gitlab.com/ee/ssh/README.html|GitLab Official Documentation]]  
 + 
 +You can also use a key generator such as [[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|PuTTYgen]] instead of using the terminal. Please refer to the guidelines of the product on how to create the RSA key and the location of the file.
  
 ===== Add an SSH key ===== ===== Add an SSH key =====
-If you already have an SSH key login to GitLab and go to → Profile Settings → SSH Keys. In the field Key copy the contents of the file: id_rsa.pub (or any other file containing your key).  +Login to Gitlab and go in your profile → Main Settings → SSH Keys.  
-Once you click Add Key, you will see the it listed.+ 
 +In the field Key copy the contents of the file: id_rsa.pub (or any other file containing your key).  
 + 
 +Choose a name to identify the key (ex. YourComputerName) and click Add Key, you will see the it listed.
  
 ===== Configure your local Git Client ===== ===== Configure your local Git Client =====
  
 Before proceeding check if your GIT client is already configured.  Before proceeding check if your GIT client is already configured. 
-LINUX/MACOSX terminal or Windows GIT bash , type the following: <code>git config --global --list</code> <code> git config --list </code>+Linux/macOS terminal or Windows Git Bash, type the following: <code> git config --global --list</code> <code> git config --list </code>
  
-If you use only one server for Git repositories configure it globally, otherwise locally+This command lists any existing GIT repositories configurations.  
 +If you have an already existing configuration, configure it locally for a specific project. If you have no other GIT configurations you can configure it globally.
  
 ==== Global GIT configuration ==== ==== Global GIT configuration ====
Line 74: Line 102:
  
 <code txt> <code txt>
-cd repository_folder+cd repository_folder_in_your_computer
 git config user.name "Firstname Lastname" git config user.name "Firstname Lastname"
-git config user.email "your_other@email"+git config user.email "your@email"
 </code> </code>
  
 Should you receive this message  **fatal: not in a git directory**, you have to initialize the folder as a git folder. Issue command : <code> Should you receive this message  **fatal: not in a git directory**, you have to initialize the folder as a git folder. Issue command : <code>
 git init git init
-</code> and run commands again.  +</code> and run git commands again.  
  
 ===== Basic Git ===== ===== Basic Git =====
/data/www/wiki.inf.unibz.it/data/pages/auth_gitlab.txt · Last modified: 2020/04/02 11:25 by apano