# comandos

### para ver la configuración de GIT

```bash
git config [options]
```

opción: -l, --list: muestra la configuración actual

### configurar usuario

```
git config --global user.name "Hernando Enrique Moreno Moreno"
```

### configurar email

```
git config --global user.email "hemoreno33@misena.edu.co"
```

### crear mi repositorio

dentro de la carpeta para ingresar usar el comando CD

```
git init
```

### Cambiar el nombre del branch inicial

```
git config --global init.defaultBranch main
```

### Adicionar archivos al área de preparación

```
git add .
```

añade todos los archivos al área de preparación

```bash
git add [nombre del archivo]
```

adiciona un archivo

### Confirmar(commit)

```
git commit -m "mensaje del commit"
git commit
```

### comandos vim

```
presionar la tecla escape
```

sirve para entrar comando

```
:w  //guarda
:q  //salir editor
:wq  //guarda y sale
:w!  // no guarda ignora los cambios
```

```
tecla i
```

la tecla i para insertar texto en el archivo

### clonar repositorios

{% tabs %}
{% tab title="clona branch por default" %}

```bash
git clone https://github.com/libgit2/libgit2
```

{% endtab %}

{% tab title="clona un branch especifico" %}

```
git clone https://github.com/libgit2/libgit2 mylibgit
```

{% endtab %}
{% endtabs %}

clona repositorios con una rama especifica

### mover un archivo de área de preparación(staging area) a el área de trabajo(working tree)

```
git restore --staged <file>...
git restore --staged 
```


---

# 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://sena-ceet.gitbook.io/2252819-trimestre-2/git/comandos.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.
