Skip to main content

Git

Students at EPITA must submit their assignments using Git. Git is a version control system, tracking changes in code and facilitating collaboration among multiple contributors. This system ensures that each iteration of a project is documented, making it easier to identify and revert to specific versions if needed. Git is widely used in IT, including companies.

EPITA provides a dedicated Git server for assignments, enabling students to store and manage their code. Additionally, a GitLab instance is hosted by the Forge. Through GitLab, students can create repositories and collaborate with peers.

SSH Key authentication

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

tip

If you're using Windows, install Git Bash, a native set of tools that bring a Bash shell used to run Git from the command line.

Generating an SSH Key Pair

OpenSSH provides a tool called ssh-keygen to generate and modify key pairs. A key pair is composed of a private key (without extension by default) and a public key (.pub by default). You can learn more about its options by running man 1 ssh-keygen.

To generate a key pair, you can use:

ssh-keygen -a 100 -t ed25519
  • -a 100: Specifies the number of key derivation function (KDF) rounds. In this case, it sets the KDF rounds to 100. Increasing the number of rounds enhances the key's security.
  • -t ed25519: Specifies the type of key to create, in this instance, an Ed25519 key. Ed25519 is known for its strong security properties and efficiency.

The command will ask you for the file in which to store your keys. Press enter to leave the default value. Then you'll be asked to enter the key's passphrase twice.

danger

It is not recommended to generate a private key without a passphrase.

Publishing your public key

Now that you own a key pair, you need to publish your public key on your Forge profile:

  1. Retrieve your public key using:
cat ~/.ssh/id_ed25519.pub
  1. Copy the public key value
  2. Go to your Forge Profile, then click on SSH keys
  3. Paste your public key, enter a title and then click on Add SSH key
https://cri.epita.fr/me

Forge SSH Keys

info

SSH key sync with the intranet is instant but sync on GitLab only runs once a day.

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:

git config --global user.name 'Xavier Login'
git config --global user.email 'xavier.login@epita.fr'