Housekeeping: delete merged remote branches (117 of 119 heads are fully merged into main) and prune local clones #246
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#246
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's requested
Clean up stale branches on the Forgejo server (git.packden.us/crueber/walhub) and in local clones so the repo isn't carrying dead refs.
Evidence (measured 2026-09-09)
main(git branch -r --merged origin/main). The repo uses squash/rebase merges, so the merged set includes branches git still shows as "unmerged" by patch content — but the ref graph confirms they're ancestors of main.main(keep), 103fix/issue-Nbranches spanning #31 → #237 (every one of those issues has a closed/merged PR), 15feat/*long-lived integration branches (feat/checks,feat/identity,feat/pulls, …), 1docs/issue-76.fix/issue-236(open PR #245, tip51a6220, committed today 2026-09-09). Everything else is deletable.f39c4cf Merge pull request 'Fix #229…' (#230)); branch deletion loses nothing — the commits are reachable from main.Tasks
teathis can also be done per-branch via the web UI, but batchedgit push origin --deleteis fastest. Keep:main,fix/issue-236(open PR #245).git push origin --delete --force-with-leaseis NOT wanted here; plain delete refuses non-fast-forward surprises anyway.git tag archive/feat-checks origin/feat/checks). Recommend deletion; the archive-tag alternative if Chris wants breadcrumbs.git remote prune origin(orgit fetch --prune) in every working clone; local worktree copies of merged branches can go viagit branch -d(safe, refuses unmerged).Acceptance criteria
git ls-remote --heads origin | wc -lreturns 2 (main + fix/issue-236) once PR #245 merges, then 1.git branch -r --merged origin/mainshows no leftover deletable branches after prune.fix/issue-236still exists with open PR #245; all other deleted branches are ancestors of main (verifiable from the pre-deletion ref graph — snapshot it first withgit for-each-ref > refs-backup.txt).git fetch --prunereports no stale remotes).Housekeeping done: all 117 fully-merged remote heads deleted (verified zero open PRs, zero unmerged branches first); local worktrees/branches pruned, remotes pruned. Only origin/main remains. Closing.