# Configurar git

Despues de instalar git, necesitamos una configuracion minima para subir nuestro codigo a github

Lanzamos cada linea, no necesitamos permisos de root.

```shell
git config --global credential.helper store
git config --global user.name "your name"
git config --global user.email your_email@example.com
git config --global color.diff "auto"
git config --global color.status "auto"
git config --global color.branch "auto"
git config --global color.interactive "true"
git config --global help.format "html"
```

\
Ahora vamos a generar las claves ssh

```shell
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
```

```shell
Generating public/private rsa key pair.
Enter file in which to save the key (/home/$USER/.ssh/id_rsa): 
Created directory '/home/$USER/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/$USER/.ssh/id_rsa.
Your public key has been saved in /home/$USER/.ssh/id_rsa.pub.
```

Copiamos nuestra clave

```shell
cat /home/$USER/.ssh/id_rsa.pub
```

\
Y lo pegamos en nuestro panel de configuracion en Github

<https://github.com/settings/ssh/new>

<figure><img src="/files/MrWw0Zc5H9dYDr8dCmnL" alt=""><figcaption></figcaption></figure>

Guardamos y probamos la conexion ssh

```shell
ssh -T git@github.com
```

```shell
The authenticity of host 'github.com (140.82.121.3)' can't be established.
ECDSA key fingerprint is SHA256:XXXXXXXXXXXXXXXXXXXX/XXXXXXXX/XXXXXXXX.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com,140.82.121.3' (ECDSA) to the list of known hosts.
Hi AzagraMac! You've successfully authenticated, but GitHub does not provide shell access.
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.azagra.dev/linux/configurar-git.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
