# Configure Workspace

## Install git for windows (Git Bash)

[https://gitforwindows.org/](https://gitforwindows.org/)

You can use everywhere the default settings except for the defualt editor, select there "Use Visual Studio code as Git's default editor"

[![image-1649585613539.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/i3gSelXiKkuQAhE8-image-1649585613539.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/i3gSelXiKkuQAhE8-image-1649585613539.png)

## Generate an ssh-key

1\. Open "Git Bash" and type the following command to create an SSH-Key

```shell
ssh-keygen.exe -t <type> -b <bit ammount> -c <Your identifing comment>
# For example
ssh-keygen.exe -t ed25519 -b 4096 -C "janic @ windows pc"
```

2\. Now you are prompted to enter the path to the key. You can use the default. (just press enter and do not enter anything)

3\. Now you are prompted to enter a password for your key. The default is no password. (just press enter and do not enter anything)

4\. Now you are prmpted to confirm your password, if you have entered none, just hit enter again.

[![image-1649586272021.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/p4Ms9ZodMZTDQghY-image-1649586272021.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/p4Ms9ZodMZTDQghY-image-1649586272021.png)

## Always use your custom ssh-key

1\. Navigate to your home directory with the comand `cd`

2\. Navigate in your ssh config directory with the command `cd .ssh`

3\. List the content of this directory with the command `ls` you should now see you custom key in here.

4\. Create a config file which defines to always use your custom ssh-key you can use the command below

```shell
echo "IdentityFile ~/.ssh/<your ssh key>" > config
# For example:
echo "IdentityFile ~/.ssh/id_ed25519" > config
```

[![image-1649586664467.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/ZOLrvE88EIriLg9F-image-1649586664467.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/ZOLrvE88EIriLg9F-image-1649586664467.png)

## Add your Public SSH-Key to Gitea

1\. Login to your gitea account

2\. Click in the top right on your profile and there on "Settings"

[![image-1649586810609.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/mtK94w3K3jAbDPee-image-1649586810609.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/mtK94w3K3jAbDPee-image-1649586810609.png)

3\. Get the content of your public key

You can use the cat command to open the content of the public key.

```shell
cat <your public key>
# For example:
cat id_ed25519.pub
```

[![image-1649587919704.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/dOsQXUHp3AezVuWn-image-1649587919704.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/dOsQXUHp3AezVuWn-image-1649587919704.png)

4.Follow the steps below

Go to "SSH- / GPG-Key"

Click on "add key"

Enter the name of this key

Enter the content of the public key

Click on "Add Key"

[![image-1649587072219.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/tbW0lKgiprgjGlPT-image-1649587072219.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/tbW0lKgiprgjGlPT-image-1649587072219.png)

## Configure Git

You need to set a default username and email for git. You can do this with the following commands

```shell
git config --global user.name "Name"
git config --global user.email "e@mail.com"
#For example:
git config --global user.name "Janic Voser"
git config --global user.email "janic@voser.cloud"
```

[![image-1649588158797.png](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/scaled-1680-/CdnHGxoi0pDwAoC2-image-1649588158797.png)](https://bookstack.voser.cloud/uploads/images/gallery/2022-04/CdnHGxoi0pDwAoC2-image-1649588158797.png)