Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Choose a specific organization-owned fork as the pull request head

Đang mở
#14,512 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cli, go, shell
Lĩnh vực
cli, developer-experience

Hướng nghiên cứu

The change involves the gh pr create command. Start by examining the command's argument parsing and the logic for resolving the head repository in the codebase, likely in the pkg/cmd/pr/create directory. Look for existing handling of the --head flag and how it interacts with forks. The feature requires understanding GitHub's API for creating pull requests and how to specify a repository-qualified head. Testing will involve verifying the new syntax works correctly and that the --web flag error is properly implemented.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

needs-triage
Describe the feature or problem you’d like to solve

An organization can own more than one fork that could supply a pull request branch. An organization and branch alone are therefore not always enough to identify the contributor’s intended head repository.

As a contributor working in an organization with multiple forks, I want to identify the exact head repository, so that the pull request is created from the fork I intended.

Proposed solution

Allow gh pr create --head ORGANIZATION/REPOSITORY:BRANCH to identify the exact organization-owned head repository.

Feature: Choose a specific organization-owned fork as the pull request head

  Scenario: The selected fork belongs to another organization
    Given the base repository is "org/upstream"
    And "other-org/upstream-fork" is a fork of the base repository
    When the contributor runs `gh pr create --head other-org/upstream-fork:feature-branch`
    Then a pull request is created from "other-org/upstream-fork:feature-branch"
    And the pull request targets "org/upstream"

  Scenario: The selected fork belongs to the same organization as the base repository
    Given the base repository is "org/upstream"
    And "org/upstream-fork" is a fork of the base repository
    When the contributor runs `gh pr create --head org/upstream-fork:feature-branch`
    Then a pull request is created from "org/upstream-fork:feature-branch"
    And the pull request targets "org/upstream"

  Scenario: The organization owns multiple candidate forks
    Given the base repository is "org/upstream"
    And "org/upstream-fork" is a fork of the base repository
    And "org/experimental-upstream-fork" is a fork of the base repository
    When the contributor runs `gh pr create --head org/upstream-fork:feature-branch`
    Then a pull request is created from "org/upstream-fork:feature-branch"
    And the pull request targets "org/upstream"

  Scenario: Repository-qualified head is combined with web mode
    When the contributor runs `gh pr create --head other-org/upstream-fork:feature-branch --web`
    Then the command fails before opening a browser
    And the error explains that a repository-qualified `--head` cannot be used with `--web`
    And the error tells the contributor to omit `--web` or select the fork on GitHub
Additional context

This is a sub-issue of #10093.

This issue introduces the repository-qualified ORGANIZATION/REPOSITORY:BRANCH form. The --web behavior may be refined if GitHub’s web pull-request flow can identify the exact head repository.

Ngôn ngữ chính
Go
Star
46.3k
Fork
9.1k
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
76

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cli/cli

Tất cả issue của cli/cli

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.