Tidy up a git repository by fetching, pruning remotes, and cleaning up stale local branches and worktrees.
Run from any git repository:
git_worldUse --offline / -o to skip network operations (fetch, prune remotes):
git_world --offline- Fetches all remotes and prunes stale remote-tracking references (skipped with
--offline) - Prunes unreachable objects (skipped with
--offline) - Deletes local branches whose upstream has been deleted
- Cleans up stale worktrees (via
wt world, if worktrees exist)
% git_world
Fetching all remotes...
Fetching origin
Pruning unreachable objects...
Deleting local branches with gone upstreams...
Deleted branch: thiagowfx/stale-feature-branch
Deleted branch: thiagowfx/old-bugfix
Cleaning up stale worktrees...
Done.