| name | git-manager |
| description | Advanced Git workflow management — repos, branches, PRs, conflicts, and automation. |
Git Manager
Advanced Git workflow management — repos, branches, PRs, conflicts, and automation.
Category: dev-tools
API Key Required: No (GitHub CLI optional)
What It Does
Helps manage Git workflows beyond basic commits. Branch management, merge conflict resolution, interactive rebasing, cherry-picking, repository health checks, and GitHub PR workflows. Your agent becomes your Git power user.
Agent Commands
Repository overview
echo "Branch: $(git branch --show-current)"
echo "Status:"
git status -s
echo "Recent commits:"
git log --oneline -10
echo "Remotes:"
git remote -v
Branch management
git branch -a
git checkout -b feature/new-thing
git branch --merged main | grep -v 'main' | xargs -r git branch -d
git branch -vv
Smart commit
git add -A
git diff --cached --stat
echo "---"
git diff --cached
Find what changed
git log --since="yesterday" --oneline --all
git log --author="NAME" --oneline -20
git diff main..HEAD --stat
git log --grep="search term" --oneline
Undo mistakes
git reset --soft HEAD~1
git reset HEAD file.txt
git checkout -- .
git reflog | head -20
git checkout -b recovered-branch COMMIT_SHA
Stash management
git stash push -m "description"
git stash list
git stash pop
git stash apply stash@{2}
Merge and rebase
git merge main
git rebase main
git rebase -i HEAD~5
git merge --abort
git rebase --abort
Cherry-pick
git cherry-pick COMMIT_SHA
Repository health
echo "Size: $(du -sh .git | awk '{print $1}')"
echo "Commits: $(git rev-list --count HEAD)"
echo "Contributors: $(git shortlog -sn --all | wc -l)"
echo "Largest files:"
git rev-list --objects --all | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | awk '/^blob/ {print $3, $4}' | sort -rn | head -10
Clean up
git clean -nd
git clean -fd
git gc --prune=now
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch PATH/TO/LARGE/FILE' HEAD
GitHub integration (with gh CLI)
gh pr create --title "Feature: New thing" --body "Description here"
gh pr list
gh pr status
gh pr merge PR_NUMBER --squash
gh pr diff PR_NUMBER
gh issue create --title "Bug: something broken" --body "Details"
gh issue list
Useful aliases
git config --global alias.lg "log --graph --oneline --decorate --all"
git config --global alias.st "status -s"
git config --global alias.last "log -1 --stat"
git config --global alias.unstage "reset HEAD --"
Examples
User: "What did I change today?"
→ git log --since="today" --oneline + git diff --stat
User: "I need to undo my last commit"
→ git reset --soft HEAD~1
User: "Clean up my branches"
→ List merged branches, offer to delete them
User: "Create a PR for this feature"
→ Push branch, gh pr create
Constraints
- Must be run inside a Git repository
- Interactive commands (rebase -i) need manual intervention or agent scripting
- Force pushing rewrites history — always confirm with user first
- GitHub CLI (
gh) needs one-time auth: gh auth login