| ... | @@ -2,13 +2,21 @@ Git is a "version control system". It is used by programmers to keep track of th |
... | @@ -2,13 +2,21 @@ Git is a "version control system". It is used by programmers to keep track of th |
|
|
|
|
|
|
|
Git is thus a professional way to share code between developers.
|
|
Git is thus a professional way to share code between developers.
|
|
|
|
|
|
|
|
|
On the [CECI clusters](http://www.ceci-hpc.be/), a recent version of git is available with the following command
|
|
|
|
```
|
|
|
|
module load git
|
|
|
|
```
|
|
|
|
On Linux, you can install git with the package manager. For example, with Ubuntu:
|
|
|
|
```
|
|
|
|
sudo apt install git
|
|
|
|
```
|
|
|
If you work on windows, git is not provided by Microsoft with the OS. You must install it before the next steps.
|
|
If you work on windows, git is not provided by Microsoft with the OS. You must install it before the next steps.
|
|
|
|
|
|
|
|
## Download git
|
|
## Download git (Windows)
|
|
|
|
|
|
|
|
Download the latest version of git from the website: https://git-scm.com/
|
|
Download the latest version of git from the website: https://git-scm.com/
|
|
|
|
|
|
|
|
## Install git
|
|
## Install git (Windows)
|
|
|
|
|
|
|
|
Double-click on the installer, then follow the instructions. Choose the default options except for the default editor which is configured for "vim" (an old type of editor which is rather difficult to use).
|
|
Double-click on the installer, then follow the instructions. Choose the default options except for the default editor which is configured for "vim" (an old type of editor which is rather difficult to use).
|
|
|
|
|
|
| ... | @@ -18,27 +26,30 @@ Choose one editor that you know well instead of vim. |
... | @@ -18,27 +26,30 @@ Choose one editor that you know well instead of vim. |
|
|
|
|
|
|
|
## Configure git
|
|
## Configure git
|
|
|
|
|
|
|
|
From this moment, you can use "git" by right-clicking on a folder in the windows explorer and by running "git bash here". Git is also available in any command-line window (Run "cmd", then type "git" in the terminal).
|
|
On Windows, you can use "git" by right-clicking on a folder in the windows explorer and by running "Git Bash Here". Git is also available in any command-line window (Run "cmd", then type "git" in the terminal).
|
|
|
|
|
|
|
|
On the other systems (Linux/macOS), open a terminal.
|
|
|
|
|
|
|
|
Open "git bash" and type these commands.
|
|
Then type these commands.
|
|
|
```
|
|
```
|
|
|
git config --global user.name "Your Name"
|
|
git config --global user.name "Your Name"
|
|
|
git config --global user.email "your_email@student.uliege.be"
|
|
git config --global user.email "your_email@student.uliege.be"
|
|
|
```
|
|
```
|
|
|
Git must know your name and e-mail address. All your personnal work will be identified on GitLab with these 2 strings.
|
|
Git must know your name and e-mail address. All your personal work will be identified on GitLab with these 2 strings.
|
|
|
|
|
|
|
|
## Configure SSH keys
|
|
## Configure SSH keys
|
|
|
|
|
|
|
|
The GitLab of ULiège does not allow you to use your student-ID / password for git commands. It uses a "SSH keys".
|
|
The GitLab of ULiège does not allow you to use your student-ID / password for git commands. It uses a pair of "SSH keys" (one "private key" that should never be shared with anyone and a "public key" which can be given to anyone who wants to check that you own the "private key").
|
|
|
|
|
|
|
|
Go to the "Settings" of your account (upper right corner of the GitLab website)
|
|
On GitLab, go to the [Settings](https://gitlab.uliege.be/profile) of your account (upper right corner of the GitLab website)
|
|
|
|
|
|
|
|

|
|

|
|
|
|
|
|
|
|
Then choose "SSH keys" on the menu on the left.
|
|
Then choose "SSH keys" on the menu on the left.
|
|
|
|
|
|
|
|
Follow the [procedure](https://gitlab.uliege.be/help/ssh/README#generating-a-new-ssh-key-pair) to create a SSH-key pair.
|
|
Follow the [procedure](https://gitlab.uliege.be/help/ssh/README#generating-a-new-ssh-key-pair) to create a SSH-key pair (in a "git-bash" terminal on Windows, or a terminal on the other platforms).
|
|
|
Use the RSA type, which is more compatible with older machines (such as NIC4)
|
|
|
|
|
|
Use the RSA type, which is more compatible with older machines (such as NIC4).
|
|
|
```
|
|
```
|
|
|
$ ssh-keygen -o -t rsa -b 4096 -C "demo"
|
|
$ ssh-keygen -o -t rsa -b 4096 -C "demo"
|
|
|
Generating public/private rsa key pair.
|
|
Generating public/private rsa key pair.
|
| ... | @@ -50,11 +61,11 @@ Your public key has been saved in /c/Users/boman/.ssh/id_rsa.pub. |
... | @@ -50,11 +61,11 @@ Your public key has been saved in /c/Users/boman/.ssh/id_rsa.pub. |
|
|
The key fingerprint is:
|
|
The key fingerprint is:
|
|
|
SHA256:8ijxJLH1SETJZVkbRbBUXXdlmXE17C3mspK/KrSC/Jc demo
|
|
SHA256:8ijxJLH1SETJZVkbRbBUXXdlmXE17C3mspK/KrSC/Jc demo
|
|
|
```
|
|
```
|
|
|
You can use no passphrase if you do not share your private key (if it stays on your laptop).
|
|
You can use an empty passphrase if you do not share your private key (if it stays on your laptop, or if you trust the system administrator).
|
|
|
|
|
|
|
|
The previous command created 2 files located in `/c/Users/your_name/.ssh/`. A public key `id_rsa.pub` and a private key `id_rsa`. The private key is similar to a password. Anyone who owns this file is able to behave as you on GitLab! It should never be shared if it is not protected by a password!
|
|
The previous command created 2 files located in `c:Users\your_name\.ssh\` (Windows) or `~/.ssh/` (anywhere else): a public key `id_rsa.pub` and a private key `id_rsa`. The private key is similar to a password. Anyone who owns this file is able to behave as you on GitLab! It should never be shared if it is not protected by a password!
|
|
|
|
|
|
|
|
Open the public key (file `/c/Users/your_name/.ssh/id_rsa.pub`) in an editor...
|
|
Open the public key (file `.ssh/id_rsa.pub`) in an editor...
|
|
|
|
|
|
|
|

|
|

|
|
|
|
|
|
| ... | @@ -64,7 +75,7 @@ Open the public key (file `/c/Users/your_name/.ssh/id_rsa.pub`) in an editor... |
... | @@ -64,7 +75,7 @@ Open the public key (file `/c/Users/your_name/.ssh/id_rsa.pub`) in an editor... |
|
|
|
|
|
|
|
Then click on the "Add" button.
|
|
Then click on the "Add" button.
|
|
|
|
|
|
|
|
You can test that you are able to connect to GitLab with the following command in a "git-bash terminal" (check that you target `gitlab.uliege.be` instead of `gitlab.com` in the instructions!):
|
|
You can test that you are able to connect to GitLab with the following command in a terminal (check that you target `gitlab.uliege.be` instead of `gitlab.com` in the instructions from GitLab!):
|
|
|
```
|
|
```
|
|
|
ssh -T git@gitlab.uliege.be
|
|
ssh -T git@gitlab.uliege.be
|
|
|
```
|
|
```
|
| ... | @@ -74,7 +85,7 @@ The authenticity of host 'gitlab.uliege.be (139.165.47.38)' can't be established |
... | @@ -74,7 +85,7 @@ The authenticity of host 'gitlab.uliege.be (139.165.47.38)' can't be established |
|
|
ECDSA key fingerprint is SHA256:4DyJeec4s+THW2EOZw5xjGgk6ZUcgmWjCcX33hVep7g.
|
|
ECDSA key fingerprint is SHA256:4DyJeec4s+THW2EOZw5xjGgk6ZUcgmWjCcX33hVep7g.
|
|
|
Are you sure you want to continue connecting (yes/no)? yes
|
|
Are you sure you want to continue connecting (yes/no)? yes
|
|
|
```
|
|
```
|
|
|
answer `yes` (you will be asked only once).
|
|
answer `yes` (you will be asked only once per machine).
|
|
|
```
|
|
```
|
|
|
Warning: Permanently added 'gitlab.uliege.be,139.165.47.38' (ECDSA) to the list of known hosts.
|
|
Warning: Permanently added 'gitlab.uliege.be,139.165.47.38' (ECDSA) to the list of known hosts.
|
|
|
```
|
|
```
|
| ... | @@ -85,6 +96,7 @@ If you do not get the welcome message "Welcome to GitLab`, something went wrong |
... | @@ -85,6 +96,7 @@ If you do not get the welcome message "Welcome to GitLab`, something went wrong |
|
|
|
|
|
|
|
# Clone the repository
|
|
# Clone the repository
|
|
|
|
|
|
|
|
|
You should now be able to retrieve the code from this repository with the following command:
|
|
|
```
|
|
```
|
|
|
git clone git@gitlab.uliege.be:R.Boman/gmsh-api.git
|
|
git clone git@gitlab.uliege.be:R.Boman/gmsh-api.git
|
|
|
```
|
|
```
|
| ... | |
... | |
| ... | | ... | |