Branches, tags and refs
Create, switch, rename, delete, publish, and read HEAD's reflog with Git's own reason strings.

Create, rename, switch
Creating a branch checks that the name is unused and that the start point resolves, then shows the ref movement it will make, from nothing, to the oid the start point names. Renaming runs git branch -m and shows two movements, the old name emptying and the new one filling, with the rollback step spelled out as the inverse command.
Switching is classified caution because your uncommitted work travels with you unless it collides with the target. When it would collide, you can choose the stash-assisted form, and the plan shows all three steps rather than one line labelled “switch”.
git stash push -m "WIP on main before switching to fix/session-timeout"git checkout fix/session-timeoutgit stash pop
Deleting a branch, and what the plan counts
Deletion is where a branch list can quietly cost you work, so the plan does the reachability arithmetic first. It walks the branch tip against every other ref in the repository and lists, by oid and subject, the commits that would be left with nothing pointing at them.
| Operation | Risk | Captured first |
|---|---|---|
| Delete a fully merged branch | safe | Nothing: every commit stays reachable elsewhere |
| Delete a branch holding unmerged commits | destructive | Standard capsule, untracked files included |
The destructive form adds two things: a precondition that you have confirmed force deletion, and a recommended alternative (keep the branch, or merge it first) because the honest comparison is that nothing is lost on that path. Deleting the branch you currently have checked out is refused outright.
Upstreams
Setting a tracking branch checks that the local branch exists, that the remote is configured, and that the remote-tracking ref is actually present. Fetch first if it is not. No network connection is made: this changes local Git configuration only, and the plan says which upstream was there before so the rollback step can name it. Unsetting is the same operation in reverse, and it refuses when there is no upstream to remove.
Every ref, and the reflog
The ref reader returns everything the repository has, refs/heads/, refs/remotes/, refs/tags/, refs/notes/, and GitAegis’s own refs/aegis/ namespace, where recovery refs such as the pre-force-push tip are written. You see what is actually there rather than what a branch list decided to show you.
HEAD’s reflog is read directly from Git, with Git’s own reason strings and ISO timestamps, bounded to at most 1000 entries per read. It includes movements GitAegis never caused (terminal commands, other clients) which is exactly why it is worth reading. An unborn repository returns an empty history rather than an error.
One reflog, not one per ref
This is HEAD’s reflog. There is no per-branch reflog browser in this build. For commits that nothing points at any more, including ones only a branch’s own reflog would name, use Lost Work. It scans wider than a single reflog does.
GitAegis never expires a reflog
No git gc, no git prune, no git reflog expire, not in maintenance, not in cleanup, not anywhere. Two operations in the toolkit carry the word “prune” and neither deletes an object: git remote prune removes remote-tracking refs, and git worktree prune removes registrations for directories that are already gone.