Make WordPress Core

Opened 44 hours ago

Last modified 31 hours ago

#65540 new defect (bug)

Documentation: Correct `git pull` command for syncing with upstream

Reported by: mkrndmane's profile mkrndmane Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-screenshots has-patch has-test-info
Focuses: Cc:

Description

While setting up the WordPress development environment for the first time, I followed the documentation step by step.

I forked the wordpress-develop repository, cloned my fork locally, and added the official WordPress repository as the upstream remote.

When I reached the section describing how to synchronize my local repository with upstream, I ran the documented command:

git pull --ff upstream/trunk

Git returned the following error:

fatal: 'upstream/trunk' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

After troubleshooting, I found that git pull expects the remote name and branch name as separate arguments. The following command works correctly:

git pull --ff upstream trunk

Proposed change

Replace:

git pull --ff upstream/trunk

with:

git pull --ff upstream trunk

This small documentation change would help first-time contributors avoid this confusing error during their initial setup.

I'll attach a screenshot of the error for reference.

Attachments (2)

Screenshot 2026-06-25 at 6.28.54 PM.png (98.2 KB) - added by mkrndmane 44 hours ago.
Documented command fails to execute.
Screenshot 2026-06-25 at 6.29.42 PM.png (26.7 KB) - added by mkrndmane 44 hours ago.
Failed command & succesfull command

Download all attachments as: .zip

Change History (6)

@mkrndmane
44 hours ago

Documented command fails to execute.

@mkrndmane
44 hours ago

Failed command & succesfull command

#1 @mukesh27
44 hours ago

  • Component changed from Text Changes to Build/Test Tools
  • Version trunk deleted

Thanks for the issue.

Can you open PR with the changes you want to propose?

This ticket was mentioned in PR #12318 on WordPress/wordpress-develop by @mkrndmane.


44 hours ago
#2

  • Keywords has-patch added

Fix the documented git pull command used for syncing with the upstream repository.

The README currently shows:

git pull --ff upstream/trunk

This PR updates it to:

git pull --ff upstream trunk

This matches Git's expected syntax (git pull <remote> <branch>) and avoids the fatal error encountered during the initial repository setup.

Trac ticket: https://core.trac.wordpress.org/attachment/ticket/65540/

## Use of AI Tools

AI assistance: Yes

Tool(s): ChatGPT

Model(s): GPT-5.5

Used for: Assisted in drafting the Trac ticket and Pull Request description. I verified the issue, tested the command locally, and prepared the final documentation change myself.

#3 @mkrndmane
43 hours ago

@mukesh27 I have opened PR & linked to this ticket

#4 @khokansardar
31 hours ago

  • Keywords has-test-info added; needs-testing removed

Patch testing report

Patch / PR tested

Environment

OS: macOS 26.5.1
git: 2.43.0
Local wordpress-develop checkout

Note

This is a documentation-only change (one line in README.md), so it was validated by reproducing the git behaviour directly rather than via the browser/Docker environment.

Steps

  1. Created a throwaway local repo with an upstream remote and a trunk branch (mirroring the setup described in the README).
  2. Ran the currently-documented command: git pull --ff upstream/trunk.
  3. Ran the command proposed by the PR: git pull --ff upstream trunk.
  4. Confirmed the string upstream/trunk appears only once in README.md.

Results

  • Reproduce bug (before): pass — git pull --ff upstream/trunk fails with the exact error from the ticket: fatal: 'upstream/trunk' does not appear to be a git repository (exit 1). Git treats upstream/trunk as the repository name.
  • Apply fix (after): pass — git pull --ff upstream trunk resolves remote upstream + branch trunk correctly and completes successfully (exit 0).
  • Scope check: pass — diff changes exactly one line; upstream/trunk occurs only once in README.md, so no other instance was missed.

Conclusion
PR #12318 corrects the documented sync command from git pull --ff upstream/trunk to git pull --ff upstream trunk, matching Git's git pull <remote> <branch> syntax and eliminating the fatal error first-time contributors hit during setup. The change is minimal, idiomatic, and scoped strictly to the ticket — single line, no behavioural or backward-compatibility impact. Recommend commit.

Note: See TracTickets for help on using tickets.