|
|
|
# Getting started with ITN GitLab #
|
|
|
|
This wiki contains some information about how to getting started with GitLab and Git.
|
|
|
|
|
|
|
|
## 1. Setting up Git software
|
|
|
|
There are several Git Softwares that can be used. Some softwares also have Git integrated .
|
|
|
|
|
|
|
|
### 1.1 Using git-scm
|
|
|
|
The most basic Git software is called Git SCM. Git SCM supports both command line Git and a graphical user interface.
|
|
|
|
1. Download Git SCM from the [Git SCM website].(https://git-scm.com/)
|
|
|
|
2. Install Git SCM with default settings.
|
|
|
|
3. Open Git SCM and create a test Git repository.
|
|
|
|
4. Go to the Options under the Edit menu.
|
|
|
|
5. Make sure that the User Name and Email adress corresponds to your full name and LiU-ID e-mail in the Global (All Repositories) settings.
|
|
|
|

|
|
|
|
|
|
|
|
### 1.2 Using Eclipse
|
|
|
|
Eclipse comes with Git integrated in most bundles.
|
|
|
|
1. Go to the Preferences under the Window menu.
|
|
|
|
2. Find the Git settings by filtering on Git.
|
|
|
|
3. Make sure that the name and email adress corresponds to your full name and LiU-ID e-mail in the Configuration tab. This can be done by adding an new entry.
|
|
|
|

|
|
|
|
4. Find the SSH settings by filtering on SSH.
|
|
|
|
5. Make sure that the SSH2 home points to the .ssh folder on your computer and the
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
## 2. Setting up GitLab account
|
|
|
|
|
|
|
|
## 2.1 Creating an account.
|
|
|
|
The first step is to create an account on the [ITN GitLab server](https://gitlab.itn.liu.se). This is done by going to the website and signing in with LiU-ID.
|
|
|
|
The account is connected to the LiU-ID and the e-mail that is corresponding to the LiU-ID.
|
|
|
|

|
|
|
|
|
|
|
|
## 2.2 Creating SSH-key
|
|
|
|
SSH-keys are used in Git for an easier and more safe connection between the local and remote repositories. There are several ways to generate SSH-key.
|
|
|
|
|
|
|
|
### Generating using ssh-keygen (Linux, Unix, Git Bash)
|
|
|
|
This method for generating SSH-keys are prefered when using any Unix based operating system or Git Bash.
|
|
|
|
1. Start the command line or Git Bash.
|
|
|
|
2. Run ssh-keygen, it is prefered to have a block size of 4096 and having some kind of comment on the key.
|
|
|
|
3. Chose the default file name by hitting enter.
|
|
|
|
4. Chose a password for the key.
|
|
|
|
|
|
|
|
```
|
|
|
|
rasri17@tal-back:~$ ssh-keygen -b 4096 -t rsa -C "Home machine"
|
|
|
|
Generating public/private rsa key pair.
|
|
|
|
Enter file in which to save the key (/home/rasri17/.ssh/id_rsa):
|
|
|
|
Created directory '/home/rasri17/.ssh'.
|
|
|
|
|
|
|
|
Enter passphrase (empty for no passphrase):
|
|
|
|
Enter same passphrase again:
|
|
|
|
Your identification has been saved in /home/rasri17/.ssh/id_rsa
|
|
|
|
Your public key has been saved in /home/rasri17/.ssh/id_rsa.pub.
|
|
|
|
The key fingerprint is:
|
|
|
|
dc:6b:2c:a3:4e:37:48:11:f7:7f:14:9a:c7:f4:90:5b Home machine
|
|
|
|
The key's randomart image is:
|
|
|
|
+--[ RSA 4096]----+
|
|
|
|
| . . +. |
|
|
|
|
| o . =.+E|
|
|
|
|
| . . o +o.|
|
|
|
|
| o . . o. |
|
|
|
|
| . S . . . |
|
|
|
|
| . . . . . |
|
|
|
|
| o = + |
|
|
|
|
| . o = |
|
|
|
|
| .o |
|
|
|
|
+-----------------+
|
|
|
|
```
|
|
|
|
### Generating using PuTTY Key Generator
|
|
|
|
The PuTTY Key Generator can be used on Windows.
|
|
|
|
1. Download puttygen.exe from the [PuTTY website](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)
|
|
|
|
2. Start puttygen.exe.
|
|
|
|
3. Run the generator for a SSH-2 RSA with a prefered block size of 4096.
|
|
|
|
4. Fill in comment and passphrase for the key.
|
|
|
|
5. Copy the public key for OpenSSH in the top part of the window, this will be used on the GitLab webpage.
|
|
|
|
6. Export the private key to as an OpenSSH key from the Conversions menu.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
### Generating using Git Gui (not recommended)
|
|
|
|
There is a way to generate SSH-keys from Git Gui.
|
|
|
|
1. Start Git Gui.
|
|
|
|
2. Show SSH-key from the Help menu.
|
|
|
|
3. Generate key.
|
|
|
|
4. Copy the Public key, this will be used on the GitLab webpage.
|
|
|
|

|
|
|
|
|
|
|
|
## 2.3 Adding SSH-key to GitLab
|
|
|
|
1. Log in to [ITN GitLab](https://gitlab.itn.liu.se)
|
|
|
|
2. Go to settings by clicking on the avantar in the upper right corner of the website.
|
|
|
|
3. Go to SSH keys.
|
|
|
|
4. Paste in the public SSH key (see section 2.2)
|
|
|
|
5. Fill in with a title and add the key. |
|
|
\ No newline at end of file |