cheat_sheet_chuleta_de_git_para_sysadmins
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| cheat_sheet_chuleta_de_git_para_sysadmins [2022/12/12 11:45] – [Historial de commits y búsquedas] busindre | cheat_sheet_chuleta_de_git_para_sysadmins [2024/05/28 21:09] (current) – [Ramas y etiquetas] busindre | ||
|---|---|---|---|
| Line 102: | Line 102: | ||
| <code bash> | <code bash> | ||
| git branch -avv # Lista todas las ramas y algunos commits. | git branch -avv # Lista todas las ramas y algunos commits. | ||
| + | git branch -r # Lista las ramas remotas (se puede usar con --merged y --no-merged) | ||
| + | git branch --merged | ||
| + | git branch --no-merged | ||
| + | |||
| git branch < | git branch < | ||
| git checkout < | git checkout < | ||
| Line 107: | Line 111: | ||
| git checkout -b < | git checkout -b < | ||
| - | git branch -d < | + | git branch -d < |
| - | git branch -d < | + | git branch -D < |
| - | git branch -d `git branch --merged | grep -v \* | xargs` | + | git branch -d `git branch --merged | grep -v \* | xargs` |
| git push origin --delete < | git push origin --delete < | ||
| Line 118: | Line 122: | ||
| git show < | git show < | ||
| + | </ | ||
| + | |||
| + | Eliminar varias ramas de forma simultanea | ||
| + | <code bash> | ||
| + | # Borra todas las tamas locales ya fusionadas excluyendo master y XXX. | ||
| + | git branch --merged | grep -Ev " | ||
| + | |||
| + | # Elimina | ||
| + | git branch -r --merged | grep -Ev " | ||
| + | |||
| + | # Listar y borrar ramas locales que hayan sido eliminadas en el remoto. "< | ||
| + | git remote prune < | ||
| + | git remote prune < | ||
| </ | </ | ||
| Line 218: | Line 235: | ||
| # Se busca el commit perteneciente a la Pull request, por ejemplo 0ef16eb1370 y se le indica a git que debe coger ese commit. | # Se busca el commit perteneciente a la Pull request, por ejemplo 0ef16eb1370 y se le indica a git que debe coger ese commit. | ||
| git cherry-pick 0ef16eb1370</ | git cherry-pick 0ef16eb1370</ | ||
| - | ===== Deshacer acciones ===== | + | ===== Deshacer |
| <code bash>git reset --hard HEAD # Deshace todos los cambios locales. | <code bash>git reset --hard HEAD # Deshace todos los cambios locales. | ||
| Line 228: | Line 245: | ||
| git checkout < | git checkout < | ||
| git reset < | git reset < | ||
| + | git restore --staged | ||
| + | |||
| # NOTA: En la sección " | # NOTA: En la sección " | ||
cheat_sheet_chuleta_de_git_para_sysadmins.1670841912.txt.gz · Last modified: 2022/12/12 11:45 by busindre
