나는 Github CLI를 시도했고... 다시는 브라우저를 열지 않았습니다!
gh로 할 수 있는 더 멋진 일을 찾았습니다.영감
이 게시물에서는 내가 일반적으로 매일 강력하게 권장하는 1가지 주요 명령(
gh pr <command>)에 대해 살펴보겠습니다.분할불
 맥 OS
$ brew install github/gh/gh brew update && brew upgrade gh 윈도우
Scoop을 통해
gh 설치:scoop bucket add github-gh https://github.com/cli/scoop-gh.git
scoop install gh
리눅스
Linux 및 기타 플랫폼의 경우 다른 설치에 대해서는 여기GitHub page를 참조하십시오.
일반 흐름 대 새로운 Github CLI
PR 생성의 이전 프로세스:
(feat/login)$ git add . (feat/login)$ git commit -m "init skeleton code for login" (feat/login)$ git push origin feat/login Create a PR 이제
gh pr create를 사용할 때 얼마나 많은 단계를 밟는지 봅시다.(feat/login)$ git add . (feat/login)$ git commit -m "init skeleton code for login" 삼.
(feat/login)$ gh pr create
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 4 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 444 bytes | 444.00 KiB/s, done.
Total 5 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
To github.com:calvinqc/trivin.git
   1c179cb..7953ecc  HEAD -> gh-testing
Branch 'feat/login' set up to track remote branch 'feat/login' from 'origin'.
Creating pull request for feat/login into master in calvinqc/trivin
? Title [WIP] Login API
? Body <Received>
? What's next? Submit
https://github.com/calvinqc/trivin/pull/1
옵션
출처Github CLIs:
  -a, --assignee login   Assign people by their login
  -B, --base string      The branch into which you want your code merged
  -b, --body string      Supply a body. Will prompt for one otherwise.
  -d, --draft            Mark pull request as a draft
  -f, --fill             Do not prompt for title/body and just use commit info
  -l, --label name       Add labels by name
  -m, --milestone name   Add the pull request to a milestone by name
  -p, --project name     Add the pull request to projects by name
  -r, --reviewer login   Request reviews from people by their login
  -t, --title string     Supply a title. Will prompt for one otherwise.
  -w, --web              Open the web browser to create a pull request
쉬운 1줄 명령:
$ gh pr create -t "[WIP] Login API" -b "Init skeleton code for Login API" -r "calvinqc" -l "feat" -p "Roadmap" -B dev
$
gh pr create에 대해 내가 좋아하는 한 가지가 있다면 푸시 + 동시에 PR을 생성한다는 것입니다.모든 PR 나열
$ gh pr list
Pull requests for calvinqc/trivin
#2  [WIP] Register API  feat/register
#1  [WIP] Login API     feat/login
PR 보기
$ gh pr view 1
Opening https://github.com/calvinqc/trivin/pull/1 in your browser
모든 PR의 상태 가져오기
$ gh pr status
Relevant pull requests in calvinqc/trivin
Current branch
  #1  [WIP] Login API     feat/login
   - Checks passing
Created by you
  #2  [WIP] Register API  feat/register
   - Checks passing
  #1  [WIP] Login API     feat/login
   - Checks passing
Requesting a code review from you
  You have no pull requests to review
PR 확인
이는 일반 분기 체크아웃과 매우 유사하지만 체크아웃한 다음 해당 분기에서 코드를 가져올 필요가 없습니다.
$ gh pr checkout 1
연결하자
Reference
이 문제에 관하여(나는 Github CLI를 시도했고... 다시는 브라우저를 열지 않았습니다!), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/calvinqc/save-more-time-with-github-cli-gh-pr-create-2bb8텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)