`repo view` resolves to upstream on forks
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
- fork a repo and clone it
- run
gh repo view -w
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
`repo view` resolves to upstream on forks
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
- fork a repo and clone it
- run
gh repo view -w
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