Last active
July 24, 2020 12:33
-
-
Save cokealmonacid/9c4350f547a301fec5c4d282a50b1432 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clonar un repositorio remoto | |
---------------------------- | |
git remote add origin url-remote-repository | |
git pull origin master (o rama a clonar) | |
Traer ramas remotas a local | |
---------------------------- | |
git fetch origin (con esto traemos todas las ramas remotas) | |
git branch -a | |
git checkout -b nombre_rama_local remotes/origin/nombre_rama_remota | |
Actualizar repositorio | |
---------------------------- | |
git fetch | |
git merge origin master | |
Eliminar ramas remotas en seguimiento | |
---------------------------- | |
git fetch --prune | |
Hacer rebase | |
---------------------------- | |
Para hacer rebase es necesario copiar la rama remota, después posicionarse en esta y hacer | |
$git rebase rama-a-utilizar | |
Luego resolver conflictos | |
**no olvidar** hacer git push origin <nombre_rama> —force | |
Ver estado del repositorio | |
---------------------------- | |
git status | |
Agregar archivos para seguimientos | |
---------------------------- | |
git add nombre-de-archivo | |
git add . , $git add -A (agregar todos los archivos a seguimiento) | |
Crear commit | |
---------------------------- | |
git commit -m "Este es el comentario del commit" | |
Subir cambios al repositorio remoto | |
---------------------------- | |
git push origin repositorio-remoto | |
Resetear puntero de archivos seguidos | |
---------------------------- | |
git reset HEAD | |
Guardar estado actual del repositorio | |
---------------------------- | |
git stash | |
Listar los cambios guardados en stash | |
---------------------------- | |
git stash list | |
Ver cambio a recuperar | |
---------------------------- | |
git stash show -p stash@{0} (o cualquier cambio a revisar) | |
Moverse a ese cambio | |
---------------------------- | |
git stash apply stash@{0} | |
Eliminar los cambios guardados | |
---------------------------- | |
git stash drop | |
Revisar los branch existentes | |
---------------------------- | |
git branch | |
Revisar los branch remotos existentes | |
---------------------------- | |
git remote show origin | |
Crear un branch nuevo | |
---------------------------- | |
git branch nombre-repositorio | |
Cambiarse de branch | |
---------------------------- | |
git checkout nombre-repositorio | |
Cambiarse a un branch remoto | |
---------------------------- | |
git checkout remote/nombre-repositorio | |
Excluir archivos de los commit | |
Crear un archivo .gitignore y agregar los archivos o carpetas a excluir | |
Ignorar archivo de repositorio | |
---------------------------- | |
git rm —cached archivo o ruta | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment