mirror of
https://gitlab.waag.org/make/fablab/interns/2025/sam.git
synced 2025-08-03 03:44:58 +00:00
26 lines
1.3 KiB
Markdown
26 lines
1.3 KiB
Markdown
# Git setup
|
|
|
|
For me setting up git and ssh keys was really straight forward because I am currently studying IT.
|
|
|
|
## Generating ssh keys
|
|
To be able to push and pull from the git server you need to give your public key to the git server. First we need te generate a ssh key. That can be done using this command.
|
|
```bash
|
|
ssh-keygen
|
|
```
|
|
After you run this command it will prompt you for a passphrase and a location to store it you can leave these blank and press enter on them. It will automaticly store them in `<user>/.ssh`.
|
|
|
|
## Reading the ssh keys
|
|
|
|
To read the ssh keys from the file you can use the `cat` command. `cat` reads the contents of a file no matter what file type it is and prints it out console.
|
|
|
|
The command wil probably look like this.
|
|
```bash
|
|
cat .ssh/id_ed25519.pub
|
|
```
|
|
Once you run that it outputs a key. That key is your public ssh key. You can share it with everyone and put it on server as a way to authenticate.
|
|
|
|
## Registering your key on the gitlab server
|
|
|
|
Now you can register the key that got output in the console on the gitlab server. First click your profile picture in gitlab and then go to edit profile. Now you have a menu bar on the left, there you can click the SSH Keys tab and register your ssh key. After you have done that you can push and pull from your gitlab repository.
|
|
|