>_FoxiRef
>_/cheatsheet/github
GitHub

GitHub CLI Cheatsheet

Comandos GitHub CLI (gh) de uso frecuente

#Autenticación

ComandoDescripción
gh auth loginIniciar sesión en GitHub
gh auth logoutCerrar sesión
gh auth statusVerificar estado de autenticación
gh auth refreshActualizar token de autenticación
gh auth switchCambiar cuenta

#Repositorio

ComandoDescripción
gh repo create [name]Crear nuevo repositorio
gh repo clone [repo]Clonar repositorio
gh repo fork [repo]Hacer fork del repositorio
gh repo viewVer información del repositorio
gh repo view --webAbrir en navegador
gh repo list [user]Listar repositorios
gh repo delete [repo]Eliminar repositorio
gh repo rename [new-name]Renombrar repositorio

#Issues

ComandoDescripción
gh issue listListar issues
gh issue createCrear issue (interactivo)
gh issue create -t "[title]" -b "[body]"Crear issue (en línea)
gh issue view [number]Ver detalles del issue
gh issue close [number]Cerrar issue
gh issue reopen [number]Reabrir issue
gh issue edit [number]Editar issue
gh issue comment [number] -b "[body]"Agregar comentario al issue

#Pull Request

ComandoDescripción
gh pr listListar PRs
gh pr createCrear PR (interactivo)
gh pr create -t "[title]" -b "[body]"Crear PR (en línea)
gh pr view [number]Ver detalles del PR
gh pr checkout [number]Cambiar a rama del PR
gh pr merge [number]Fusionar PR
gh pr merge --squashSquash y fusionar
gh pr merge --rebaseRebase y fusionar
gh pr close [number]Cerrar PR
gh pr review [number]Revisar PR
gh pr diff [number]Ver diferencias del PR

#GitHub Actions

ComandoDescripción
gh run listListar ejecuciones de workflow
gh run view [run-id]Ver detalles de ejecución
gh run watch [run-id]Observar progreso de ejecución
gh run rerun [run-id]Volver a ejecutar workflow
gh run cancel [run-id]Cancelar ejecución
gh run download [run-id]Descargar artefactos
gh workflow listListar workflows
gh workflow run [workflow]Ejecutar workflow manualmente
gh workflow enable [workflow]Habilitar workflow
gh workflow disable [workflow]Deshabilitar workflow

#Releases

ComandoDescripción
gh release listListar releases
gh release create [tag]Crear release
gh release create [tag] --generate-notesGenerar notas automáticamente
gh release view [tag]Ver detalles del release
gh release download [tag]Descargar assets del release
gh release upload [tag] [files]Subir assets
gh release delete [tag]Eliminar release

#Gist

ComandoDescripción
gh gist listListar gists
gh gist create [file]Crear gist
gh gist create --public [file]Crear gist público
gh gist view [id]Ver gist
gh gist edit [id]Editar gist
gh gist clone [id]Clonar gist
gh gist delete [id]Eliminar gist

#API y otros

ComandoDescripción
gh api [endpoint]Llamar API de GitHub
gh api graphql -f query="..."Consulta GraphQL
gh browseAbrir repo actual en navegador
gh browse [file]Abrir archivo en navegador
gh alias set [alias] "[command]"Establecer alias de comando
gh extension listListar extensiones
gh extension install [repo]Instalar extensión

#Preguntas frecuentes (FAQ)

이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.

GitHub CLI Cheatsheet - Referencia de comandos gh | Foxi Dev Reference