Describe the bug
Briefly: gh repo list sorts by most recent update to any branch, while gh repo list --no-archived sorts by most recent update to the default branch only, but both display the date of the most recent update to any branch, leading to confusing behavior.
After pushing a commit to a non-default branch, gh repo list correctly moves the repository to the top based on its displayed UPDATED value. However, gh repo list --no-archived displays the same, correct UPDATED value, but the item appears in the same position it appeared in before the new commit.
Consequently, the --no-archived output is not sorted by the UPDATED values it displays, which is inconsistent with the default behavior of gh repo list. Notably, the sorting places the repo based on the last update to the repo's default branch.
Affected version
gh version 2.96.0 (2026-07-02)
https://github.com/cli/cli/releases/tag/v2.96.0
Steps to reproduce the behavior
- Fork
cli/scoop-gh.
- Clone the fork.
- Create a non-default branch named
test.
- Make and commit a change on
test.
- Push
test to the fork.
- Run
gh repo list.
- Run
gh repo list --no-archived.
- Compare the position of
scoop-gh in the two outputs.
Expected vs actual behavior
I expect gh repo list to have the same sorting with and without the --no-archived flag, but for the archived entries to just drop from the list.
gh repo list behaves as expected, sorting by UPDATED. gh repo list --no-archived has unexpected behavior, displaying UPDATED correctly but instead appears to sort repos by UPDATED for the default branch (not displayed).
Logs
Unrelated repositories have been omitted. Two unrelated repository names and their descriptions have also been anonymized.
... # fork is made
❯ gh repo list
Showing 7 of 7 repositories in @bburns-ds
NAME DESCRIPTION INFO UPDATED
bburns-ds/repo1 private about 27 days ago
bburns-ds/repo2 private about 7 months ago
bburns-ds/scoop-gh [DEPRECATED] scoop packaging for the github cli public, fork about 3 years ago
❯ gh repo list --no-archived
Showing 7 of 7 repositories in @bburns-ds
NAME DESCRIPTION INFO UPDATED
bburns-ds/repo1 private about 27 days ago
bburns-ds/repo2 private about 7 months ago
bburns-ds/scoop-gh [DEPRECATED] scoop packaging for the github cli public, fork about 3 years ago
... # repo is cloned, branch is made, commit is made on branch, change is pushed
❯ gh repo list
Showing 24 of 24 repositories in @bburns-ds
NAME DESCRIPTION INFO UPDATED
bburns-ds/scoop-gh [DEPRECATED] scoop packaging for the github cli public, fork less than a minute ago
bburns-ds/repo1 private about 27 days ago
bburns-ds/repo2 private about 7 months ago
❯ gh repo list --no-archived
Showing 7 of 7 repositories in @bburns-ds
NAME DESCRIPTION INFO UPDATED
bburns-ds/repo1 private about 27 days ago
bburns-ds/repo2 private about 7 months ago
bburns-ds/scoop-gh [DEPRECATED] scoop packaging for the github cli public, fork less than a minute ago
Describe the bug
Briefly:
gh repo listsorts by most recent update to any branch, whilegh repo list --no-archivedsorts by most recent update to the default branch only, but both display the date of the most recent update to any branch, leading to confusing behavior.After pushing a commit to a non-default branch,
gh repo listcorrectly moves the repository to the top based on its displayedUPDATEDvalue. However,gh repo list --no-archiveddisplays the same, correctUPDATEDvalue, but the item appears in the same position it appeared in before the new commit.Consequently, the
--no-archivedoutput is not sorted by theUPDATEDvalues it displays, which is inconsistent with the default behavior ofgh repo list. Notably, the sorting places the repo based on the last update to the repo's default branch.Affected version
Steps to reproduce the behavior
cli/scoop-gh.test.test.testto the fork.gh repo list.gh repo list --no-archived.scoop-ghin the two outputs.Expected vs actual behavior
I expect
gh repo listto have the same sorting with and without the--no-archivedflag, but for the archived entries to just drop from the list.gh repo listbehaves as expected, sorting byUPDATED.gh repo list --no-archivedhas unexpected behavior, displayingUPDATEDcorrectly but instead appears to sort repos byUPDATEDfor the default branch (not displayed).Logs
Unrelated repositories have been omitted. Two unrelated repository names and their descriptions have also been anonymized.