forked from tuttifruttihat/latinoamerica
Añade comandos
This commit is contained in:
parent
ae3e999500
commit
d048a91233
|
@ -1,60 +1,96 @@
|
|||
|
||||
## Recursos Git
|
||||
### Recursos Git
|
||||
|
||||
### Manuales
|
||||
## Manuales
|
||||
|
||||
- [En inglés](https://git-scm.com/docs)
|
||||
|
||||
### Comandos
|
||||
## Comandos
|
||||
|
||||
- Verificar cambios en el directorio de trabajo
|
||||
``` git status ```
|
||||
|
||||
- Cambiar entre ramas de un repositorio
|
||||
``` git switch <nombre-de-la-rama> ```
|
||||
```
|
||||
git switch <nombre-de-la-rama>
|
||||
```
|
||||
|
||||
- Preparar los cambios para actualizar un archivo
|
||||
``` git add <nombre-del-archivo> ```
|
||||
```
|
||||
git add <nombre-del-archivo>
|
||||
```
|
||||
|
||||
- Preparar los cambios para actualizar todos los archivos
|
||||
``` git add . ```
|
||||
```
|
||||
git add .
|
||||
```
|
||||
|
||||
- Hacer commit de todos los cambios que están en la fila
|
||||
``` git commit -m "Mensaje del commit" ```
|
||||
```
|
||||
git commit -m "Mensaje del commit"
|
||||
```
|
||||
|
||||
- Cargar los commits al repositorio remoto
|
||||
``` git push origin master ```
|
||||
```
|
||||
git push origin <nombre-de-la-rama>
|
||||
```
|
||||
|
||||
- Crear una rama y cambiar hacia ella
|
||||
``` git checkout -b <nombre-de-la-nueva-rama> ```
|
||||
- Crear una rama y cambiar hacia ella
|
||||
```
|
||||
git checkout -b <nombre-de-la-nueva-rama>
|
||||
```
|
||||
|
||||
- Cambiar el nombre del archivo
|
||||
``` git mv <nombre-original> <nuevo-nombre> ```
|
||||
- Cambiar el nombre del archivo
|
||||
```
|
||||
git mv <nombre-original> <nuevo-nombre>
|
||||
```
|
||||
|
||||
- Añadir el repositorio local a otro remoto
|
||||
``` git remote add <nombre-del-repositorio> <servidor-del-repositorio-remoto> ```
|
||||
- Añadir el repositorio local a otro remoto
|
||||
```
|
||||
git remote add <nombre-del-repositorio> <servidor-del-repositorio-remoto>
|
||||
```
|
||||
|
||||
- Verificar si el repositorio remoto fue añadido
|
||||
``` git remote get-url <nombre-del-repositorio> ```
|
||||
```
|
||||
git remote get-url <nombre-del-repositorio>
|
||||
```
|
||||
|
||||
- También se puede usar para verificar el nuevo repositorio
|
||||
``` git .cat/config ```
|
||||
```
|
||||
git .cat/config
|
||||
```
|
||||
- Borrar un archivo:
|
||||
```
|
||||
git rm <nombre-del-archivo>
|
||||
```
|
||||
- Borrar una carpeta:
|
||||
```
|
||||
git rm -r <nombre-de-la-carpeta>
|
||||
```
|
||||
|
||||
- [Cheat Sheet](https://quickref.me/git)
|
||||
|
||||
### Llaves SSH
|
||||
|
||||
- Verificar si existe llave:
|
||||
``` ls -al ~/.ssh ```
|
||||
```
|
||||
ls -al ~/.ssh
|
||||
```
|
||||
|
||||
- Crear una llave:
|
||||
``` ssh-keygen -t ```
|
||||
```
|
||||
ssh-keygen -t
|
||||
```
|
||||
|
||||
- Ver la llave:
|
||||
``` cat ~/.ssh/id_rsa.pub ```
|
||||
```
|
||||
cat ~/.ssh/id_rsa.pub
|
||||
```
|
||||
|
||||
- Editar la URL del proyecto:
|
||||
``` vim .git/config```
|
||||
```
|
||||
vim .git/config
|
||||
```
|
||||
|
||||
### Alternativas a Git
|
||||
- [Mercurial](https://www.mercurial-scm.org/)
|
||||
|
|
Loading…
Reference in New Issue