Git Workbench is a powerful, professional CLI suite designed to enhance your Git and GitHub workflow. It provides a set of interactive tools to simplify common tasks, enforce conventions, and visualize repository data.
Git Workbench includes a comprehensive suite of tools:
- Git Basics: Interactive guide to learn and execute core Git commands.
- Git Clean: safely remove merged branches and keep your repository tidy.
- Git Stats: Visualize repository statistics, including contributor activity and file breakdowns.
- Git Undo: Interactive menu to safely undo recent Git operations (commits, merges, stages).
- PR Maker: Generate professional Pull Request descriptions from your commit history using templates.
- Git Who: Analyze code contributions by author with percentage breakdowns.
- Commit Lint: Enforce and validate Conventional Commit messages.
- Python 3.8 or higher
- Git installed and available in your PATH
Clone the repository and install in editable mode:
git clone https://github.com/Rohan7654/git_workbench.git
cd git_workbench
pip install -e .Once installed, you can use the gw command (or git_workbench) to access the suite.
Launch the interactive main menu:
gwYou can also run specific tools directly:
# Clean up merged branches
gw clean
# View repository statistics
gw stats
# Interactive undo menu
gw undo
# Generate a PR description
gw pr
# Analyze contributors
gw who
# Validate commit messages
gw lintSee what Git Workbench looks like in action.
Running gw launches the central hub:
╭────── Git Workbench Suite ──────╮
│ │
│ Select a tool to get started │
│ │
╰───────────────────────────────────╯
Git Basics Learn & execute basic git commands
Git Clean Remove merged branches, clean up repos
Git Stats Beautiful git statistics for a repo
Git Undo Easily undo git operations
PR Maker Generate PR descriptions from commits
Git Who Show who contributed what % of code
Commit Lint Enforce conventional commit messages
Exit
gw stats gives you a comprehensive overview:
╭──────────────── Git Statistics ─────────────────╮
│ │
│ Comprehensive repository analysis │
│ │
╰─────────────────────────────────────────────────╯
Analyzing repository... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
╭────────────── Repository Overview ──────────────╮
│ Metric Value │
│ ─────────────────────────────────────────────── │
│ Total Commits 1,243 │
│ Contributors 12 │
│ Total Files 89 │
│ Branches 5 │
│ Repository Age 245 days │
╰─────────────────────────────────────────────────╯
gw undo helps you recover from mistakes safely:
╭────────────────── Git Undo ──────────────────╮
│ │
│ Safely undo git operations with guidance │
│ │
╰──────────────────────────────────────────────╯
Current State:
Last commit: a1b2c3d - Fix login bug
Staged: 2 | Modified: 1 | Untracked: 0
[?] What do you want to undo?
> Last commit (keep changes staged)
Last commit (keep changes unstaged)
Last commit (discard all changes)
Last merge
Staged files (unstage all)
gw pr generates descriptions from your work:
╭────────── PR Description Generator ──────────╮
│ │
│ Create beautiful PR descriptions from commits│
│ │
╰──────────────────────────────────────────────╯
Recent Commits:
a1b2c3d Fix login bug
e4f5g6h Update documentation
[?] Select a template:
> Standard - Comprehensive template with checklist
Minimal - Simple and concise format
Feature - For new feature PRs
Bugfix - For bug fix PRs
gw clean keeps your repository tidy:
╭────────────────── Git Clean ───────────────────╮
│ │
│ Remove merged branches and clean up the repo │
│ │
╰────────────────────────────────────────────────╯
[?] Select branches to delete:
> [x] feature/login-page (merged)
[ ] feature/new-api (merged)
[x] hotfix/typo-fix (merged)
gw basics is your interactive guide:
╭───────────── Git Basics ─────────────╮
│ │
│ Learn and execute basic git commands │
│ │
╰────────────────────────────────────────╯
[?] Select a category to explore:
> Setup & Config
Information
Staging & Commits
Branching & Merging
Remote Operations
Undo Operations
Advanced
Show All Commands
gw who reveals the top contributors:
╭────────────────── Git Who ───────────────────╮
│ │
│ Analyze code contributions by author │
│ │
╰──────────────────────────────────────────────╯
Analyzing contributions... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
Contributions by Commits
Rank Author Commits Percentage Contribution
1st Dev One 450 36.2% ████████████░░░░░░░░░░░░
2nd Dev Two 320 25.7% ████████░░░░░░░░░░░░░░░░
3rd Dev Three 150 12.1% ████░░░░░░░░░░░░░░░░░░░░
gw lint enforces your commit standards:
╭──────────────── Commit Lint ─────────────────╮
│ │
│ Validate conventional commit messages │
│ │
╰──────────────────────────────────────────────╯
Checking last 10 commits...
╭─ Status ── Hash ──── Type ────── Message ────────────────────────╮
│ ✓ a1b2c3d feat Add new login page component │
│ ✓ e4f5g6h fix Resolve issue with auth token │
│ ✗ i7j8k9l - wip fixing stuff │
╰──────────────────────────────────────────────────────────────────╯
Summary:
Valid: 9
Invalid: 1
Needs improvement. Only 90% of commits are valid.
GitAssist comes with a comprehensive test suite. To run the tests, install the development dependencies and use pytest:
pip install pytest pytest-mock
pytestContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.