git.md 1.53 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
# Git configuration

Students at EPITA have to use SSH Key-Based Authentication to access their Git
repositories.

## Generating an SSH Key Pair

OpenSSH provides a tool called `ssh-keygen` to generate and modify key pairs.
You can learn more about its options by running `man 1 ssh-keygen`.

A key pair is composed of a private key (without extension by default) and a
public key (.pub by default).
13

14
15
To generate a key pair, you can use:
```bash
16
ssh-keygen -a 100 -t ed25519
17
```
18

19
20
21
22
23
/!\ It is not recommended to generate a private key without passphrase.

## Pushing your public key

Now that you own a key pair, you need to push your public key on the
24
25
[CRI Website](https://cri.epita.fr/). Your keys can be managed using `SSH Keys`
on your profile.
26
27
28

Your public key can be retrieved using:
```bash
29
cat "$HOME/.ssh/id_ed25519.pub"
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
```

## Configuring Git

While `git-config` can be used for much more than just configuring your
identity, this will be the only part covered in this documentation.

Your identity, composed of a name and an email will be used to author your
commits. You can set them by using the following commands:
```bash
git config --global user.name 'Firstname LASTNAME'
git config --global user.email 'firstname.lastname@epita.fr'
```

## git-autoconfig

A tool called git-autoconfig is available on Archlinux SUP. This script will
generate a key, configure your git and push your public key on the CRI website.
While this is the easiest way, this tool has its limitations. It is instead
recommended to follow the steps above for learning purpose.