>_FoxiRef
>_/cheatsheet/github
GitHub

GitHub CLI Cheatsheet

Comandos GitHub CLI (gh) frequentemente usados

#Autenticação

ComandoDescrição
gh auth loginFazer login no GitHub
gh auth logoutFazer logout
gh auth statusVerificar status de autenticação
gh auth refreshAtualizar token de autenticação
gh auth switchTrocar conta

#Repositório

ComandoDescrição
gh repo create [name]Criar novo repositório
gh repo clone [repo]Clonar repositório
gh repo fork [repo]Fazer fork do repositório
gh repo viewVer informações do repositório
gh repo view --webAbrir no navegador
gh repo list [user]Listar repositórios
gh repo delete [repo]Excluir repositório
gh repo rename [new-name]Renomear repositório

#Issues

ComandoDescrição
gh issue listListar issues
gh issue createCriar issue (interativo)
gh issue create -t "[title]" -b "[body]"Criar issue (inline)
gh issue view [number]Ver detalhes do issue
gh issue close [number]Fechar issue
gh issue reopen [number]Reabrir issue
gh issue edit [number]Editar issue
gh issue comment [number] -b "[body]"Adicionar comentário ao issue

#Pull Request

ComandoDescrição
gh pr listListar PRs
gh pr createCriar PR (interativo)
gh pr create -t "[title]" -b "[body]"Criar PR (inline)
gh pr view [number]Ver detalhes do PR
gh pr checkout [number]Checkout do branch do PR
gh pr merge [number]Mesclar PR
gh pr merge --squashSquash e mesclar
gh pr merge --rebaseRebase e mesclar
gh pr close [number]Fechar PR
gh pr review [number]Revisar PR
gh pr diff [number]Ver diff do PR

#GitHub Actions

ComandoDescrição
gh run listListar execuções de workflow
gh run view [run-id]Ver detalhes da execução
gh run watch [run-id]Assistir progresso da execução
gh run rerun [run-id]Reexecutar workflow
gh run cancel [run-id]Cancelar execução
gh run download [run-id]Baixar artefatos
gh workflow listListar workflows
gh workflow run [workflow]Executar workflow manualmente
gh workflow enable [workflow]Habilitar workflow
gh workflow disable [workflow]Desabilitar workflow

#Releases

ComandoDescrição
gh release listListar releases
gh release create [tag]Criar release
gh release create [tag] --generate-notesGerar notas automaticamente
gh release view [tag]Ver detalhes do release
gh release download [tag]Baixar assets do release
gh release upload [tag] [files]Enviar assets
gh release delete [tag]Excluir release

#Gist

ComandoDescrição
gh gist listListar gists
gh gist create [file]Criar gist
gh gist create --public [file]Criar 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]Excluir gist

#API e outros

ComandoDescrição
gh api [endpoint]Chamar API do GitHub
gh api graphql -f query="..."Consulta GraphQL
gh browseAbrir repo atual no navegador
gh browse [file]Abrir arquivo no navegador
gh alias set [alias] "[command]"Definir alias de comando
gh extension listListar extensões
gh extension install [repo]Instalar extensão

#Perguntas frequentes (FAQ)

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

GitHub CLI Cheatsheet - Referência de comandos gh | Foxi Dev Reference