`pr fetch` command
- Ngôn ngữ chính
- Go
- Star
- 46.3k
- Fork
- 9k
- Merge trung bình
- 2 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 97
Mô tả
### Fetching pull requests without checking them out
Usually I work with development branches and merge pull requests directly to them for testing. Most of the time, it is not necessary to actually check out the branch into a work tree, I can just merge it directly. However the GitHub CLI tool always checks out the branch.
### Proposed solution
[It is possible][1] to do this manually:
```shell
git fetch origin pull/PR-NUMBER/head:BRANCH-NAME
```
It is very annoying though since I need to look up the user and branch name and name the branch myself. It would be far more convenient to be able to run something like:
```shell
gh pr fetch PR-NUMBER
```
To simply fetch the `PR-NUMBER` pull request into a local branch in the `-` format.
[1]: https://stackoverflow.com/a/30584951
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi lệnh `gh pr` hiện có và hành vi checkout của nó, sau đó so sánh với quy trình đã được ghi lại `git fetch origin pull/PR-NUMBER/head:BRANCH-NAME`. Hoàn thành khi `gh pr fetch PR-NUMBER` fetch pull request vào một branch cục bộ `-` mà không checkout branch đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- git, github, go
- Lĩnh vực
- cli
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100