23.06.15
DEVOTEE를 활성화 시키면
지금 작성한 커뮤니티 글에 대해 1개의 댓글을 달아줍니다.
버튼을 누르면 글 수정 시 ChatGPT가 작성한 댓글이 수정됩니다.
| 컨텐츠 유형 | 제목 | 저장일 | 삭제 |
|---|
본인인증 로그인에 실패하였습니다.
회원이 아니시거나 본인인증 등록이
완료되지 않은 사용자입니다.
GitHub CLI(이하 gh) 는 GitHub 에서 제공하는 terminal 도구입니다. gh 를 이용하면 일반적인 작업 흐름인 이슈생성 -> 브랜치 생성 -> commit & push -> pull request -> merge 전체를 terminal 에서 할 수 있습니다. 느린 GitHub 의 web page loading 을 기다리지 않아도 되고, 클릭을 위해 마우스로 손을 옮기지 않아도 되기 때문에 많은 시간을 절약할 수 있습니다.
공식 홈페이지(https://cli.github.com)에서 다운로드 받거나 brew 로 간단히 설치 가능합니다.
brew install gh
auth 명령어를 통해 로그인 설정을 할 수 있습니다.
gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? SSH
? Upload your SSH public key to your GitHub account? /Users/******/.ssh/id_rsa.pub
? How would you like to authenticate GitHub CLI? Paste an authentication token
Tip: you can generate a Personal Access Token here https://github.com/settings/tokens
The minimum required scopes are 'repo', 'read:org', 'admin:public_key'.
? Paste your authentication token: ****************************************
- gh config set -h github.com git_protocol ssh
✓ Configured git protocol
✓ Uploaded the SSH key to your GitHub account: /Users/******/.ssh/id_rsa.pub
✓ Logged in as onevirus
https 나 ssh 가 아닌 gh 로 repo clone 을 할 수 있습니다. 아래에서 보이는 것 처럼 github.com 이 생략된 owner 와 repo_id 만으로 clone 이 가능하기 때문에 git 명령을 사용하는 것보다 명령어가 간결합니다.
git clone https://github.com/apache/airflow.git
git clone git@github.com:apache/airflow.git
gh repo clone apache/airflow
issue 명령어를 사용하여 list, create, view 등이 가능합니다.
gh issue list
Showing 30 of 871 open issues in apache/airflow
#18155 Upgrade `importlib-resources` version kind:feature about 14 hours ago
#18146 Deferred TI's `next_method` and `next_kwargs` not cleared on... kind:bug, area:core about 15 hours ago
#18136 Allow airflow standard images to run in openshift utilising ... kind:feature, area:helm-chart about 18 hours ago
#18133 bulk_sync_to_db got UnicodeDecodeError when Chinese characte... Enhancement, good first issue, area:core about 42 minutes ago
gh issue create
Creating issue in apache/airflow
? Title
? Body
? What's next? [Use arrows to move, type to filter]
> Submit
Continue in browser
Cancel
feature branch 생성 및 commit push 후 pr create 명령어를 사용하여 pull request 를 생성할 수 있습니다.
gh pr create --head main
Creating pull request for main into main in apache/airflow
? Title
? Body
? What's next? [Use arrows to move, type to filter]
> Submit
Continue in browser
Cancel
그리고 pr merge 명령어를 사용하여 pull request 를 merge 할 수 있습니다.
gh pr merge 18162
? What merge method would you like to use? Rebase and merge
? What's next? [Use arrows to move, type to filter]
> Submit
Cancel
run 명령어를 사용하여 github action 으로 관리되는 ci/cd 상태도 확인 가능합니다.
gh run list
STATUS NAME WORKFLOW BRANCH EVENT ID ELAPSED AGE
✓ Add script that validate version field... Label when reviewed workfl... main workflow_run 1224092992 36s 30m
✓ Remove limits for dnspython Label when reviewed remove-dnspython-limitation pull_request_review 1224092925 14s 30m
- Add script that validate version field... Build Images main push 1224090687 25m26s 31m
- Add script that validate version field... Tests main push 1224090683 11m11s 31m
✓ Add script that validate version field... CodeQL main push 1224090682 15m19s 31m
실제 단순 오타 수정의 경우 터미널에서 아래 명령어로 조합으로 github gui 를 이용하는 것보다 훨씬 빠르게 끝낼 수 있습니다.
gh issue create
git checkout -b new_branch
vim file_to_edit
git add file_to_edit
git commit -m "Fix typo"
git push
gh pr create
그 외 pull request 의 check 및 merge 도 gh 를 이용하면 터미널에서 편하게 할 수 있습니다.
DEVOTEE를 활성화 시키면
지금 작성한 댓글에 AI가 댓글을 달아줍니다.