auth:gitlab
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
auth:gitlab [2017/06/13 11:46] – apano | auth:gitlab [2021/07/05 18:09] (current) – kohofer | ||
---|---|---|---|
Line 5: | Line 5: | ||
UNIBZ users have to login to [[https:// | UNIBZ users have to login to [[https:// | ||
- | External users can sign up with their Google, Twitter, or Facebook account. The external user has to motivate the request by sending an e-mail to cs-tech@lists.inf.unibz.it. | + | External users can sign up with their Google, Twitter, or Facebook account. |
Here are some instructions on GitLab to ease its use. | Here are some instructions on GitLab to ease its use. | ||
Line 12: | Line 12: | ||
===== Initial setup ===== | ===== Initial setup ===== | ||
- | Git is usually preinstalled in Linux and Mac, check the version < | + | Git is usually preinstalled in Linux and Mac, while in Windows you have to [[https://git-scm.com/ |
- | git --version< | + | |
- | You have to instruct | + | You can have different hosts for different |
- | To check if you have any configurations saved: < | + | |
- | If your global configuration is empty then you can create a global configuration, | + | |
The steps for pushing and pulling via SSH Key | The steps for pushing and pulling via SSH Key | ||
- | * Step 1: [[https:// | + | * Step 1: [[auth: |
- | * Step 2: [[https:// | + | * Step 2: [[auth: |
- | * Step 3: Configure your local client | + | * Step 3: [[auth: |
- | ==== Global GIT configuration | + | ===== Identify or create the SSH key ===== |
- | Check if your GIT client is already configured: | + | If you need support on how to generate |
- | LINUX/ | + | |
- | < | + | ===== Add an SSH key ===== |
- | git config --list | + | 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). |
- | </ | + | Once you click Add Key, you will see the it listed. |
- | If there is no account/content, configure | + | ===== Configure your local Git Client ===== |
+ | |||
+ | Before proceeding check if your GIT client | ||
+ | LINUX/MACOSX terminal or Windows GIT bash , type the following: < | ||
+ | |||
+ | If you use only one server for Git repositories | ||
+ | |||
+ | ==== Global GIT configuration ==== | ||
+ | To configure GIT globally using the SSH key Inside the terminal/ | ||
< | < | ||
git config --global user.name " | git config --global user.name " | ||
Line 40: | Line 44: | ||
</ | </ | ||
- | The last command should show the data you entered and is your gitlab global configuration. | + | This data is stored |
- | This data is saved in the file ~/ | + | Linux/ |
+ | Windows: C: | ||
+ | The content should be: | ||
<code txt> | <code txt> | ||
[user] | [user] | ||
Line 49: | Line 55: | ||
</ | </ | ||
- | Try to checkout repo. Should you experience trouble check the contents of file: .ssh/config. You can manually insert: | + | Add your server data and insert this data in your ssh configuration file. |
+ | |||
+ | Linux/ | ||
< | < | ||
host gitlab.inf.unibz.it | host gitlab.inf.unibz.it | ||
user your_username | user your_username | ||
+ | </ | ||
+ | |||
+ | Windows file ~/ | ||
+ | < | ||
+ | Host gitlab.inf.unibz.it | ||
+ | RSAAuthentication yes | ||
+ | IdentityFile ~/ | ||
</ | </ | ||
==== Local Configuration ==== | ==== Local Configuration ==== | ||
- | You have to do it in the root of the repository. From terminal/ | + | You have to run the commands inside |
<code txt> | <code txt> | ||
Line 66: | Line 81: | ||
Should you receive this message | Should you receive this message | ||
git init | git init | ||
- | </ | + | </ |
- | ==== Add an SSH key ==== | + | |
- | If you need support on how to generate the SSH key follow our guide on [[auth: | + | |
- | 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). | + | ===== Basic Git ===== |
- | Once you click Add Key, you will see the key listed in your SSH Keys. | + | |
- | ===== Basic Git commands | + | |
The logic of git requires you to checkout a project via CLONE. You ensure the project files are up to date by issuing a PULL command. Once the modifications on the project are done, you ADD the changes, you COMMIT them and you PUSH them to the gitlab server. | The logic of git requires you to checkout a project via CLONE. You ensure the project files are up to date by issuing a PULL command. Once the modifications on the project are done, you ADD the changes, you COMMIT them and you PUSH them to the gitlab server. | ||
Line 173: | Line 184: | ||
+ | ===== Some support cases ===== | ||
+ | SourceTree failing to connect | ||
+ | * Delete entry in keychain for gitlab.inf.unibz.it | ||
+ | * Add key again to ssh client : ssh-add -K < | ||
+ | |||
+ | ===== Renew the SSL certificates - gitlab.inf.unibz.it ===== | ||
+ | |||
+ | Certificate is valid for 3 months | ||
+ | |||
+ | A cronjob renews the certificate every 1st day of the month | ||
+ | |||
+ | root@gitlab: | ||
+ | |||
+ | < | ||
+ | # At 04:05 on day-of-month 1. | ||
+ | 5 4 1 * * / | ||
+ | # At 04:10 on day-of-month 1. | ||
+ | 10 4 1 * * / | ||
+ | </ | ||
/data/www/wiki.inf.unibz.it/data/pages/auth/gitlab.txt · Last modified: 2021/07/05 18:09 by kohofer