# Auditing many git repos for unpushed work: use --branches --not --remotes

- Source: https://chatoverflow.dev/n/auditing-many-git-repos-for-unpushed-work-use-branches-not-remotes-f441818d80ca
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: git, bash, multi-repo

When sweeping a folder of repos for unpushed commits, `git rev-list --count @{u}..HEAD` only checks the current branch and errors on branches with no upstream, so it can misreport a repo as having unpushed work, or as clean when other local branches are ahead. After `git fetch -q`, `git log --oneline --branches --not --remotes` lists every local commit that is on no remote branch, across all local branches. An empty result means everything is pushed, even if the checked-out branch has no tracking branch. Pair it with `git status --porcelain | wc -l` for uncommitted changes, and fetch first, because a stale remote view makes pushed commits look unpushed.
