>_FoxiRef
>_/cheatsheet/github
GitHub

GitHub CLI Cheatsheet

Frequently used GitHub CLI (gh) commands

#Authentication

CommandDescription
gh auth loginLogin to GitHub
gh auth logoutLogout
gh auth statusCheck auth status
gh auth refreshRefresh auth token
gh auth switchSwitch account

#Repository

CommandDescription
gh repo create [name]Create new repository
gh repo clone [repo]Clone repository
gh repo fork [repo]Fork repository
gh repo viewView repository info
gh repo view --webOpen in browser
gh repo list [user]List repositories
gh repo delete [repo]Delete repository
gh repo rename [new-name]Rename repository

#Issues

CommandDescription
gh issue listList issues
gh issue createCreate issue (interactive)
gh issue create -t "[title]" -b "[body]"Create issue (inline)
gh issue view [number]View issue details
gh issue close [number]Close issue
gh issue reopen [number]Reopen issue
gh issue edit [number]Edit issue
gh issue comment [number] -b "[body]"Add comment to issue

#Pull Request

CommandDescription
gh pr listList PRs
gh pr createCreate PR (interactive)
gh pr create -t "[title]" -b "[body]"Create PR (inline)
gh pr view [number]View PR details
gh pr checkout [number]Checkout PR branch
gh pr merge [number]Merge PR
gh pr merge --squashSquash and merge
gh pr merge --rebaseRebase and merge
gh pr close [number]Close PR
gh pr review [number]Review PR
gh pr diff [number]View PR diff

#GitHub Actions

CommandDescription
gh run listList workflow runs
gh run view [run-id]View run details
gh run watch [run-id]Watch run progress
gh run rerun [run-id]Rerun workflow
gh run cancel [run-id]Cancel run
gh run download [run-id]Download artifacts
gh workflow listList workflows
gh workflow run [workflow]Manually run workflow
gh workflow enable [workflow]Enable workflow
gh workflow disable [workflow]Disable workflow

#Releases

CommandDescription
gh release listList releases
gh release create [tag]Create release
gh release create [tag] --generate-notesAuto-generate release notes
gh release view [tag]View release details
gh release download [tag]Download release assets
gh release upload [tag] [files]Upload assets
gh release delete [tag]Delete release

#Gist

CommandDescription
gh gist listList gists
gh gist create [file]Create gist
gh gist create --public [file]Create public gist
gh gist view [id]View gist
gh gist edit [id]Edit gist
gh gist clone [id]Clone gist
gh gist delete [id]Delete gist

#API & Others

CommandDescription
gh api [endpoint]Call GitHub API
gh api graphql -f query="..."GraphQL query
gh browseOpen current repo in browser
gh browse [file]Open file in browser
gh alias set [alias] "[command]"Set command alias
gh extension listList extensions
gh extension install [repo]Install extension

#Frequently Asked Questions

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