Opened 26 hours ago
Last modified 15 hours ago
#65542 new defect (bug)
Contributor Handbook: Update `gh repo fork` example to work with the current GitHub CLI
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | trunk |
| Component: | Text Changes | Keywords: | has-patch has-screenshots has-test-info |
| Focuses: | Cc: |
Description
While setting up the WordPress development environment for the first time, I followed the Contributor Handbook instructions for forking the wordpress-develop repository.
The documentation currently recommends:
gh repo fork WordPress/wordpress-develop --clone --remote
Using GitHub CLI 2.94.0 (2026-06-10), this command returns:
the `--remote` flag is unsupported when a repository argument is provided
I then retried the setup using:
gh repo fork WordPress/wordpress-develop --clone
This completed successfully and performed the expected setup:
- Forked the repository to my GitHub account.
- Cloned the repository locally.
- Added
WordPress/wordpress-developas theupstreamremote.
Based on this behavior, the --remote flag appears to be unnecessary (or no longer supported) with the current GitHub CLI, while the documented outcome is still achieved.
Proposed change
Update the documentation to use:
gh repo fork WordPress/wordpress-develop --clone
instead of:
gh repo fork WordPress/wordpress-develop --clone --remote
This would help first-time contributors avoid the confusing error while following the setup instructions.
Environment
- GitHub CLI: 2.94.0 (2026-06-10)
- I will attach a screenshot of the error message & successful command.
Attachments (2)
Change History (4)
This ticket was mentioned in PR #12321 on WordPress/wordpress-develop by @mkrndmane.
26 hours ago
#1
@
26 hours ago
Successful execution after removing --remote & can see upstream is added successfully
#2
@
15 hours ago
- Keywords has-test-info added
Patch testing report
Patch / PR tested
- https://github.com/WordPress/wordpress-develop/pull/12321
- trunk @ 87a5738363 — single-line change to README.md (+1/-1)
Note on test method
This is a documentation-only text change (README.md), so there is no runtime behaviour to reproduce in the browser. It was validated by confirming the GitHub CLI behaviour described in the ticket against the current gh source and gh repo fork --help.
Environment
OS: macOS 26.5.1
GitHub CLI (local): gh 2.90.0
Reporter's GitHub CLI: 2.94.0 (2026-06-10)
Repo: wordpress-develop trunk @ 87a5738363
Steps
- Reviewed README.md line 44 — currently documents
gh repo fork WordPress/wordpress-develop --clone --remote. - Checked
gh repo fork --helpand the GitHub CLIfork.govalidation logic. - Confirmed the error path for the documented command.
- Confirmed the updated command (
--cloneonly) still produces the three outcomes the README lists (fork, clone, add upstream as default).
Results
- Bug confirmed:
gh repo fork <repo> --clone --remotefails. GitHub CLI's fork.go guards this:if opts.Repository != "" && cmd.Flags().Changed("remote")returns the exact error the reporter quoted — "the--remoteflag is unsupported when a repository argument is provided". - Fix validated: with a repository argument,
--cloneautomatically adds theupstreamremote and sets it as the default repo, so--remotewas always redundant here. Dropping it preserves the documented outcome exactly. - Docs accuracy: README lines 45–47 (fork to account / clone / add upstream and set default) remain fully accurate after the change. No other text needs updating.
- Scope: diff is a single line in README.md, +1/-1. No code, no other files, no scope creep.
Conclusion
PR #12321 removes the unsupported --remote flag from the documented gh repo fork example in README.md. The documented command currently errors out on current GitHub CLI versions for first-time contributors; the updated command works and still yields the same fork/clone/upstream setup the README describes. The change is minimal, idiomatic, and scoped strictly to the ticket, with no backward-compatibility or performance implications. Recommend commit.
This PR updates the GitHub CLI example used when forking the
wordpress-developrepository.### Current command
### Updated command
### Why?
While following the contributor documentation for the first time, I encountered the following error when running the documented command with GitHub CLI 2.94.0:
Running the command without
--remotesuccessfully:This update aligns the documentation with the current behavior of the GitHub CLI and helps prevent confusion for new contributors.
Fixes: https://core.trac.wordpress.org/ticket/65542
## Use of AI Tools
AI assistance: Yes
Tool(s): ChatGPT
Model(s): GPT-5.5
Used for: Drafting the Trac ticket and pull request description. I verified the issue, tested the commands locally, and reviewed the final content before submission.