Skip to main content
commitdog branch gives you an interactive menu for all common branch operations. Each subcommand is also available directly so you can jump straight to what you need without going through the menu. Branch names are validated before any git operation runs, and main and master are protected from deletion in all cases.

Commands

commitdog branch

Running commitdog branch without any subcommand shows a numbered menu:
Pick a number to enter that flow, or q to quit.

commitdog switch

commitdog switch jumps directly to the branch switcher. It shows your current branch and up to five other recent branches by number, plus an e option to type a name:
Pick a number to switch, e to type a branch name manually, or q to quit.

commitdog branch create

commitdog branch create suggests branch names if you have staged changes. Names are derived from the same diff analysis used for commit messages — added function names, file names, and the inferred scope:
After picking or entering a name, commitdog asks for a base branch (defaults to your current branch):
Once the branch is created and you are switched to it, commitdog asks whether to push the new branch to the remote:

commitdog branch delete

commitdog branch delete lists all branches that can be deleted — the current branch, main, and master are never shown. Each branch is labeled (merged) or (unmerged) so you know its status at a glance:
Selecting an unmerged branch triggers an extra confirmation warning:
If the branch exists on the remote, commitdog then asks whether to delete it there too:

commitdog branch ls

commitdog branch ls prints all local and remote branches. Your current branch is highlighted with an arrow:

commitdog merge

commitdog merge lists all other branches and shows how many lines and files each one adds relative to your current branch. Branches with potential merge conflicts are flagged:
After picking a branch, commitdog prints per-file stats and presents three options:
  • Choose 1 to merge immediately.
  • Choose 2 to view a paginated diff of all changes, then return to the same prompt.
  • Choose 3 to cancel.
If the branch has conflicts, commitdog skips the merge/diff prompt and instead offers to run the merge with conflicts and open each conflicted file in your $EDITOR ($VISUAL or vi as fallback), so you can resolve them before committing manually.