feat(pr): 新增 pr +checkout 本地检出 PR 分支(对标 gh pr checkout) #356
Loading…
Reference in New Issue
No description provided.
Delete Branch "Taoyouce/gitlink-cli:feat/pr-checkout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
评审一个 PR 时最常见的动作是把它的分支拉到本地跑起来。目前需要手工查 PR 的 head 分支和 fork 地址再敲 git 命令;gh CLI 的高频命令
gh pr checkout证明了这一步值得封装。变更
pr +checkout -i <PR序号> [-b 本地分支名](在 git 克隆目录内执行):git fetch <remote> head:local && git checkout local,git 输出走 stderr,结构化结果(pull/branch/remote)走 stdout 管道安全-b自定义本地分支名(默认与 head 同名)测试
pr +checkout -i 355(fork PR)自动从 fork 地址抓取并切到 feat/repo-clone