Git
Branches review
Every local branch in a server's repository, measured against the base — merged, stale or gone upstream — with a cleanup line for you to run.
Opening the review#
On a server's Git tab, the Repository card has a Review branches button. Quick actions offers the same thing: press Q, find the server — typing branches or review with its name narrows it — and choose Review branches. The review takes over the server's screen until Back to the server, or ←, takes you back.
It reads the repository's files in .git and runs no git command, and nothing on it deletes, renames or checks out a branch. Because those files have to be on this computer, the review is offered only for servers running directly here: a server in WSL or a container has no button, and neither does a repository that keeps its refs in the reftable format. A server whose folder sits on a WSL share is turned away with “Pip reviews branches only for servers on this computer, not in WSL or a container.”
The base branch#
Every verdict is measured against one branch, named in the header: “Compared with origin/main · stale after 30 days”. Pip looks on the remote your current branch tracks — otherwise origin, or the only remote there is — and takes the first of these that exists: the remote's default branch, your init.defaultBranch, main, master, and last of all the branch you are on. When the remote has a copy, the copy is what gets compared — origin/main rather than your local main — so the verdicts are as fresh as your last fetch. With no base at all, the header says “No base branch found” and no branch can be judged.
Squash and rebase merges
A branch merged by squash or rebase never lands in the base as itself, so it reads Not in main however finished it is — the review says as much above the list. The sign to look for is Upstream gone: hosts delete a branch once it is merged, and also once it is abandoned, so it is a reason to look, not proof.
Reading a row#
Each local branch is a row, newest activity first: its name, with a button that copies it, and a line saying what last touched it. Usually that is “Last commit 3 days ago”. It reads “Moved here 2 hours ago” when the reflog records a move later than the commit — a branch made yesterday from an old commit, say — or when the commit's date is not in git's commit graph. Failing both, it reads “File dated 3 days ago” from the branch's ref file, or “No date on disk”. Then the badges:
- HEAD
- The branch checked out where this server runs.
- Checked out in …
- A working tree holds it, named by its folder — this tree, the main tree or a worktree when it cannot be named — or Rebasing in or Bisecting in when a rebase of it, or a bisect started from it, is under way there, this tree included. git refuses to delete a branch a working tree holds.
- Base
- The branch everything else is compared with.
- Stale
- Nothing on disk has touched it for longer than Settings → Git → Call a branch stale after: 14, 30, 60 or 90 days, and 30 unless you change it. Touched means the date the row shows, so a branch with no date is never stale. An open review keeps the interval it was read with until you read it again.
- In main / Not in main
- Whether the branch's tip is in the base's history, read from git's commit graph. The badge uses your base's own name.
- Unknown: …
- The verdict could not be worked out, and the badge says why in a word or two — no commit graph, graph out of date, shallow clone, history too deep, stopped and a few more. Point at it for the whole sentence.
- Upstream gone
- It tracked a remote branch that is no longer in your clone. That shows only once something has pruned the remote-tracking branch —
git fetch --prunedoes — and Pip's own fetch never prunes. - Merged here
- A hint, drawn quieter than the verdict: the base's reflog records a
git mergeof a branch with this name in this clone. A merge made on the host leaves no such line. - In cleanup
- The cleanup command names it.
Under the badges, a row lists the checks that matched — “Checks that matched: in main's history (commit graph), remote branch deleted.” — so what a verdict stands on is there to read without pointing at anything. A branch that is in the base but still left out of the cleanup command says why on a line of its own.
Filtering and searching#
Show, above the list, narrows it to All, Stale, In main or Gone — the branches whose upstream is gone — each with its count. With more than 20 branches a search box joins it: press / to jump into it and type any part of a name, in any case. Esc clears the search first, then closes the review. Rows arrive 200 at a time, and Show more adds the next 200.
The cleanup command#
At the foot of the review, Copy cleanup command — with the number of branches in brackets — puts one git line on your clipboard, naming every branch the review judged safe to delete:
git branch -d -- feat/login fix/header-typo spike/cachePip runs nothing: you paste the line into a terminal and run it yourself. It uses -d, never -D, so git checks each branch again as it goes — against its upstream, or the branch you have checked out — and refuses any it does not find merged. The -- keeps a name from being read as an option. Only local branches are deleted; no remote branch, tag or working tree is touched. The button is disabled when nothing qualifies, and if the repository has changed since the list was read, the copy is refused with “The repository changed since this list was read. Read it again before copying.”
Which branches it names#
A branch makes the line only when every one of these holds:
- It is in the base and in your checkout.
git branch -djudges a branch against its upstream or the branch you have checked out, not against the base, so both have to agree. - Nothing is using it. It is not the branch checked out here or the base, and no working tree holds it — not even mid-rebase or mid-bisect.
- No other branch tracks it. A local branch set to follow it would be left following nothing.
- Its name is unique, whatever the case. On Windows, and on macOS by default,
Featureandfeatureshare one ref file, so deleting one can take the other with it. - Its name is plain. Unaccented letters A to Z, digits,
._/and-, not starting with-, so the line pastes the same into PowerShell, cmd, bash and zsh. - Everything could be read. Every working tree, and the repository's config.
A squash- or rebase-merged branch never qualifies, because its tip is not in the base — deleting it is your call. A branch in the base that misses out says why on its row: “Not in the cleanup command: another branch tracks it.”
Slow, large and unusual repositories#
- Stop when it is slow. While it reads, the review shows “Reading branches…” with a Stop button. What was read is kept — “Stopped before every branch was read. Showing the 812 branches read so far.” — and a verdict it had not reached reads Unknown: stopped. Leaving the screen stops the read too, and only one review runs at a time.
- The list is a snapshot. It is never re-read under you. When you come back to the window and the repository has moved — a checkout, a fetch — a banner says “The repository changed since this list was read.” with Read again. It does not catch every change, so read again after a stretch of work in a terminal. A list left alone for five minutes is let go, and the review says so.
- Up to 4,096 branches. Past that: “Showing the first 4,096 branches; the repository has more.”
- Shallow clones and replaced history. git writes no commit graph for a shallow clone, and the graph does not describe history that grafts or replace refs rewrite, so every verdict there is unknown.
In and not in the base come from git's commit graph. A repository without one shows “No commit graph yet” and the command that writes it, which Pip does not run for you. The same command, or git gc, brings the graph up to date when rows read Unknown: graph out of date:
git commit-graph write --reachableDid this page not answer it? Tell us what you were looking for — that is how Pip's documentation gets written.