Skip to main content

A comprehensive Git & GitHub assistant

Project description

Git Workbench

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.

Features

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.

Installation

Prerequisites

  • Python 3.8 or higher
  • Git installed and available in your PATH

local Installation

Clone the repository and install in editable mode:

git clone https://github.com/Rohan7654/git_workbench.git
cd git_workbench
pip install -e .

Usage

Once installed, you can use the gw command (or git_workbench) to access the suite.

Main Menu

Launch the interactive main menu:

gw

Direct Commands

You 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 lint

Interactive Demos

See what Git Workbench looks like in action.

1. Main Menu

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

2. Git Stats

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                  │
╰─────────────────────────────────────────────────╯

3. Git Undo

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)

4. PR Maker

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

5. Git Clean

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)

6. Git Basics

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

7. Git Who

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%        ████░░░░░░░░░░░░░░░░░░░░

8. Commit Lint

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.

Testing

GitAssist comes with a comprehensive test suite. To run the tests, install the development dependencies and use pytest:

pip install pytest pytest-mock
pytest

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_workbench-1.0.0.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_workbench-1.0.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file git_workbench-1.0.0.tar.gz.

File metadata

  • Download URL: git_workbench-1.0.0.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for git_workbench-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0bbdc1077714c98c2f9a9da612b7dbf5ed337ffa7e7a3569c83d9b8512235f0c
MD5 be2425e5d4935a4d790d28920f6ba1e8
BLAKE2b-256 2aa4c9f8460806bd84e9bcee16387b6220822c6814f46eb4b4e86e13cd1129d2

See more details on using hashes here.

File details

Details for the file git_workbench-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: git_workbench-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for git_workbench-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a01ba2500a87a1ca144b6c8a6feff8d56091ec001600ee4f5a527e6c90e0b738
MD5 036a92226fb9b451b15296d93b1359b7
BLAKE2b-256 a977be917f7a9376e3cca1f38983f087b8bee265bd284c8803994e2520b2c8c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page