>_FoxiRef
>_/cheatsheet/github
GitHub

GitHub CLI 치트시트

자주 사용하는 GitHub CLI (gh) 명령어 모음

#인증

명령어설명
gh auth loginGitHub 로그인
gh auth logout로그아웃
gh auth status인증 상태 확인
gh auth refresh인증 토큰 갱신
gh auth switch계정 전환

#저장소

명령어설명
gh repo create [name]새 저장소 생성
gh repo clone [repo]저장소 복제
gh repo fork [repo]저장소 포크
gh repo view저장소 정보 보기
gh repo view --web브라우저에서 열기
gh repo list [user]저장소 목록
gh repo delete [repo]저장소 삭제
gh repo rename [new-name]저장소 이름 변경

#이슈

명령어설명
gh issue list이슈 목록
gh issue create이슈 생성 (대화형)
gh issue create -t "[title]" -b "[body]"이슈 생성 (인라인)
gh issue view [number]이슈 상세 보기
gh issue close [number]이슈 닫기
gh issue reopen [number]이슈 다시 열기
gh issue edit [number]이슈 수정
gh issue comment [number] -b "[body]"이슈에 댓글 추가

#Pull Request

명령어설명
gh pr listPR 목록
gh pr createPR 생성 (대화형)
gh pr create -t "[title]" -b "[body]"PR 생성 (인라인)
gh pr view [number]PR 상세 보기
gh pr checkout [number]PR 브랜치로 전환
gh pr merge [number]PR 병합
gh pr merge --squashSquash 머지
gh pr merge --rebaseRebase 머지
gh pr close [number]PR 닫기
gh pr review [number]PR 리뷰
gh pr diff [number]PR 변경사항 보기

#GitHub Actions

명령어설명
gh run list워크플로우 실행 목록
gh run view [run-id]실행 상세 보기
gh run watch [run-id]실행 실시간 모니터링
gh run rerun [run-id]워크플로우 재실행
gh run cancel [run-id]실행 취소
gh run download [run-id]아티팩트 다운로드
gh workflow list워크플로우 목록
gh workflow run [workflow]워크플로우 수동 실행
gh workflow enable [workflow]워크플로우 활성화
gh workflow disable [workflow]워크플로우 비활성화

#릴리즈

명령어설명
gh release list릴리즈 목록
gh release create [tag]릴리즈 생성
gh release create [tag] --generate-notes릴리즈 노트 자동 생성
gh release view [tag]릴리즈 상세 보기
gh release download [tag]릴리즈 에셋 다운로드
gh release upload [tag] [files]에셋 업로드
gh release delete [tag]릴리즈 삭제

#Gist

명령어설명
gh gist listGist 목록
gh gist create [file]Gist 생성
gh gist create --public [file]공개 Gist 생성
gh gist view [id]Gist 보기
gh gist edit [id]Gist 수정
gh gist clone [id]Gist 복제
gh gist delete [id]Gist 삭제

#API & 기타

명령어설명
gh api [endpoint]GitHub API 호출
gh api graphql -f query="..."GraphQL 쿼리
gh browse브라우저에서 현재 저장소 열기
gh browse [file]특정 파일 브라우저에서 열기
gh alias set [alias] "[command]"명령어 별칭 설정
gh extension list확장 목록
gh extension install [repo]확장 설치

#자주 묻는 질문 (FAQ)

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