`repo view` resolves to upstream on forks

#11219

Issue Details

18 days ago
cristiand391cristiand391
gh-repo
cristiand391cristiand391
opened 18 days ago
Author

Describe the bug

gh repo view (no arg parameter) on a fork resolves to the upstream repo.

Affected version

➜ shelljs-fork git:(shelljs-find-tests) gh version gh version 2.74.2 (2025-06-18) https://github.com/cli/cli/releases/tag/v2.74.2

Steps to reproduce the behavior

  1. fork a repo and clone it
  2. run gh repo view -w
  3. gh opens the upstream repo instead of the fork.

Expected vs actual behavior

I had this shell alias: ghbo=gh repo view -w --branch $(git branch --show-current)

so when I ran it on a fork today I was expecting to open the branch on my fork and open a PR in the web ui. Instead, it opened the upstream repo.

Logs

see how it resolves from upstream instead of origin

Image