Skip to content

mine git

Git workflow supercharger. Not a git replacement — a git accelerator. Shells out to the git binary with no extra dependencies.

Terminal window
mine git

Opens a fuzzy-searchable branch picker (Bubbletea). Pick a branch and press Enter to switch. Falls back to a plain list when no TTY is available (e.g., scripts, CI).

Terminal window
mine git # interactive picker
mine g # same, via alias

Delete merged local branches and prune stale remote-tracking refs.

Terminal window
mine git sweep
  • Only deletes branches already merged into the current branch
  • Skips protected branches: main, master, develop, and the current branch
  • Confirms before deleting
  • Also prunes stale origin/* refs

Soft-reset the last commit, keeping all changes staged.

Terminal window
mine git undo

Shows the commit message and prompts for confirmation before resetting.

Stage everything and create a quick WIP commit.

Terminal window
mine git wip

Equivalent to git add -A && git commit -m "wip". Use mine git unwip to undo.

Undo the last commit if its message is “wip”.

Terminal window
mine git unwip

Fails with a clear error if the last commit is not a WIP commit.

Create a pull request from the current branch.

Terminal window
mine git pr
  • Auto-detects the base branch (main, master, or develop)
  • Generates a PR title from the branch name (e.g. feat/add-oauthfeat: add oauth)
  • Generates a PR body from the commit log
  • Uses the gh CLI to create the PR if available
  • Falls back to printing the generated title/body if gh is not installed

Pretty commit log — compact, colored, graph.

Terminal window
mine git log

Shows the last 30 commits with author, subject, relative date, and branch graph.

Generate a Markdown changelog from conventional commits between two refs.

Terminal window
mine git changelog # auto-detect base..HEAD
mine git changelog --from v1.0.0
mine git changelog --from v1.0.0 --to v2.0.0

Commits are grouped into sections: Features, Bug Fixes, Documentation, Refactoring, Chores, and Other. Only sections with commits are included.

Flags:

FlagDefaultDescription
--from, -fauto (base branch)Start ref
--to, -tHEADEnd ref

Install opinionated git aliases to ~/.gitconfig.

Terminal window
mine git aliases

Installs these aliases (with confirmation):

AliasCommandDescription
git cocheckoutShortcut for checkout
git brbranchShortcut for branch
git ststatus -sbCompact status
git lglog --oneline --graph --decorate --allPretty graph log
git lastlog -1 HEAD --statLast commit with stats
git unstagereset HEAD --Unstage a file
git undoreset --soft HEAD~1Soft undo last commit
git wip!git add -A && git commit -m "wip"Quick WIP commit
git aliasesconfig --get-regexp aliasList all aliases

When you run eval "$(mine shell init)", these git helper functions are added to your shell:

FunctionDescription
gc <msg>git commit -m shorthand
gca <msg>git commit --amend -m shorthand
gpgit push with upstream tracking
gplgit pull --rebase
gsw <branch>git switch shorthand

All functions work in bash, zsh, and fish.

Terminal window
# Switch branches interactively
mine git
# Clean up after a merge
mine git sweep
# Save work in progress
mine git wip
# ... later ...
mine git unwip
# Open a PR
mine git pr
# Generate a changelog for a release
mine git changelog --from v1.2.0
# Pretty log
mine git log
# Install git aliases
mine git aliases