Skip to content

Mention new "OWNER:REPO:BRANCH" pattern in "Comparing across forks" #34381

@muzimuzhi

Description

@muzimuzhi

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/pull-requests/committing-changes-to-your-project/viewing-and-comparing-commits/comparing-commits#comparing-across-forks

What part(s) of the article would you like to see updated?

The section Comparing across forks only mentions the OWNER:BRANCH pattern to specify a compare branch in a three-dot comparison, but recently GitHub started using a new OWNER:REPO:BRANCH pattern.

To compare branches on different repositories, preface the branch names with user names. For example, by specifying octocat:main for base and octo-org:main for compare, you can compare the main branch of the repositories respectively owned by octocat and octo-org.

Here's an example of a comparison between two repositories.

The new pattern can be found in the URL of "Open pull request" pages. Such pages can be opened by visiting https://github.com/OWNER/REPO/pull/new/BRANCH or by clicking the "Open pull request" button in the page of a branch ahead of upstream default branch.

For example,

Additional information

The old form OWNER:BRANCH still works, though I don't know which one is preferable by the GitHub.

For example, https://github.com/github/docs/compare/main...muzimuzhi:gh34381-update-basehead-form?expand=1 still works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SME reviewedAn SME has reviewed this issue/PRcontentThis issue or pull request belongs to the Docs Content teamhelp wantedAnyone is welcome to open a pull request to fix this issuepull requestsContent related to pull requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions