rtk-ai/rtk

[BUG] rtk git branch -a omits remote branches; -r works correctly

Open

#2,137 创建于 2026年5月28日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Rust (2,914 fork)batch import
area:clibughelp wantedplatform:macospriority:high

仓库指标

Star
 (48,085 star)
PR 合并指标
 (平均合并 8天 17小时) (30 天内合并 49 个 PR)

描述

Description

rtk git branch -a only outputs the current local branch, silently dropping all remotes/origin/* lines. The -r flag works correctly and shows remote branches.

Steps to reproduce

# Repo with a pushed remote (origin/main)
rtk git branch -a
# Output:
# * main

rtk git branch -r
# Output:
# *
#   origin/HEAD -> origin/main
#   origin/main

# Native git (bypassing rtk) works correctly:
/usr/bin/git branch -a
# * main
#   remotes/origin/HEAD -> origin/main
#   remotes/origin/main

Expected behavior

rtk git branch -a should display both local and remote-tracking branches, matching native git branch -a output.

Environment

  • rtk version: 2.3.3
  • OS: macOS Darwin 25.5.0
  • Shell: zsh

Notes

  • rtk help for git branch describes it as "Compact branch listing (current/local/remote)", suggesting remote display is intended.
  • Workaround: use /usr/bin/git branch -a to bypass the hook.
  • Related: #1499 (branch -vv strips tracking markers)

贡献者指南