Delete a branch locally

Delete a branch locally in Git — with the four heights of help laid out: do it now, make it easier for the next person to accept, work out the right move when you are stuck, and learn the pattern so it stops coming back.

4prompt heights
Open it in the interactive atlas →

The four heights

The same task, four distances: today's deadline, the next reviewer, the stuck moment, the pattern.

Execute — do the immediate task

+
Delete the local branch feature/refactor-login on my machine — ensure I switch to main first if I…
Delete the local branch feature/refactor-login on my machine — ensure I switch to main first if I am on that branch, abort if it has unmerged commits, and give me a summary of what would be deleted before final confirmation.

Improve — make it easier to accept

+
Before I remove this local branch, make it safe to delete: show whether feature/refactor-login is…
Before I remove this local branch, make it safe to delete: show whether feature/refactor-login is merged into main or any release branch, list unpushed commits, and surface any open pull request that references it so I can avoid deleting something still in review.

Decide — diagnose the stuck moment

+
I attempted to delete feature/refactor-login locally and the tool warned about unmerged commits. I…

I tried to delete a branch and was warned about unmerged work

I attempted to delete feature/refactor-login locally and the tool warned about unmerged commits. I can't remember whether those commits were intentionally kept or accidentally left behind. I need to know if they exist on any remote or on main so deleting won't lose work. What's the best sequence to verify whether those commits are safe to drop or need to be rescued first?

Become — change the pattern

+
Developers repeatedly delete local branches then later complain they lost staging work because we…

We keep resurrecting local branches we already removed remotely

Developers repeatedly delete local branches then later complain they lost staging work because we didn't check remotes or open PRs. I want a one-minute routine to teach the team so local deletions don't cause data loss or confusion. What specific checks and a short pre-delete checklist should everyone follow?

Next to this one

Other version control work people do in Git.

Every task here came from the work, not from a feature list — which is why the prompts name what you want done and never the button that does it. The tool changes; the work does not.
Copyright © LLOS.ai · 2026 — original pedagogy, voice, and design — all rights reserved.

The rest of the map

Same library, five ways in.