{"id":29240091,"url":"https://github.com/daveschumaker/gbm","last_synced_at":"2026-05-15T01:10:50.574Z","repository":{"id":301298670,"uuid":"1008655667","full_name":"daveschumaker/gbm","owner":"daveschumaker","description":"A CLI Git branch management tool that provides an interactive interface for managing Git branches with pleasant visual feedback and helpful features.","archived":false,"fork":false,"pushed_at":"2025-06-27T20:01:01.000Z","size":413,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-11T20:36:15.242Z","etag":null,"topics":["cli","git","terminal-based","utility"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daveschumaker.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-25T22:20:37.000Z","updated_at":"2025-09-12T13:36:06.000Z","dependencies_parsed_at":"2025-10-19T23:39:22.824Z","dependency_job_id":null,"html_url":"https://github.com/daveschumaker/gbm","commit_stats":null,"previous_names":["daveschumaker/gbm"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/daveschumaker/gbm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daveschumaker%2Fgbm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daveschumaker%2Fgbm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daveschumaker%2Fgbm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daveschumaker%2Fgbm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daveschumaker","download_url":"https://codeload.github.com/daveschumaker/gbm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daveschumaker%2Fgbm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33049608,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","git","terminal-based","utility"],"created_at":"2025-07-03T19:09:52.361Z","updated_at":"2026-05-15T01:10:50.546Z","avatar_url":"https://github.com/daveschumaker.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Branch Manager\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/git-branch-manager.webp\" alt=\"Git Branch Manager Logo\" width=\"400\"\u003e\n\u003c/p\u003e\n\nA powerful terminal-based (TUI) Git branch management tool that provides an interactive interface for managing Git branches with rich visual feedback and advanced features.\n\n![Git Branch Manager](https://img.shields.io/badge/git-branch--manager-blue)\n![Python](https://img.shields.io/badge/python-3.6%2B-green)\n![License](https://img.shields.io/badge/license-MIT-blue)\n\n## Screenshot\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/screenshot.png\" alt=\"Git Branch Manager Screenshot\" width=\"800\"\u003e\n\u003c/p\u003e\n\n## Features\n\n### Core Functionality\n- **Interactive TUI**: Navigate branches with arrow keys in a clean, professional interface\n- **Branch Operations**: Checkout, delete, rename, and create branches with ease\n- **Visual Indicators**: \n  - `*` Current branch\n  - `↓` Remote branches\n  - `[modified]` Uncommitted changes\n  - `[unpushed]` Local branches not on remote\n  - `[merged]` Branches merged into main/master\n  - `[worktree]` Branches in other worktrees\n- **Smart Stash Management**: \n  - Automatic prompt to stash changes when switching branches\n  - Track and recover stashes with 'S' key\n  - Branch-specific stash detection\n- **Remote Branch Support**: Toggle viewing and checkout remote branches\n- **Branch Protection**: Extra confirmation for deleting main/master branches\n- **Worktree Support**: Shows worktree indicators and prevents conflicts\n\n### Advanced Features\n- **Powerful Filtering**: \n  - Search by name (`/`)\n  - Filter by author (`a`)\n  - Hide old branches (`o`)\n  - Hide merged branches (`m`)\n  - Filter by prefix (`p`)\n- **Smart Sorting**: Branches sorted by most recent commits\n- **Color Coding**: Age-based coloring for quick visual scanning\n- **Browser Integration**: Open branches in GitHub, GitLab, Bitbucket, etc.\n- **Performance Optimized**: Progressive loading with caching for instant startup, even in large repos\n- **Professional UI**: Nano-style footer with command shortcuts\n\n## Installation\n\n### Requirements\n- Python 3.6+\n- Git\n- Terminal with color support\n\n### Quick Install (curl)\n\n```bash\n# Download and install to /usr/local/bin (requires sudo)\nsudo curl -L https://raw.githubusercontent.com/daveschumaker/gbm/main/git-branch-manager.py -o /usr/local/bin/git-bm\nsudo chmod +x /usr/local/bin/git-bm\n\n# Or install to ~/.local/bin (no sudo required)\nmkdir -p ~/.local/bin\ncurl -L https://raw.githubusercontent.com/daveschumaker/gbm/main/git-branch-manager.py -o ~/.local/bin/git-bm\nchmod +x ~/.local/bin/git-bm\n\n# Add ~/.local/bin to PATH if not already present\n# For bash: echo 'export PATH=\"$HOME/.local/bin:$PATH\"' \u003e\u003e ~/.bashrc \u0026\u0026 source ~/.bashrc\n# For zsh:  echo 'export PATH=\"$HOME/.local/bin:$PATH\"' \u003e\u003e ~/.zshrc \u0026\u0026 source ~/.zshrc\n\n# Now you can run from anywhere\ngit-bm\n\n# Or as a git alias\ngit config --global alias.bm '!git-bm'\ngit bm  # Now works as a git subcommand!\n```\n\n### Install from Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/daveschumaker/gbm.git\ncd gbm\n\n# Make executable\nchmod +x git-branch-manager.py\n\n# Option 1: Run directly\n./git-branch-manager.py\n\n# Option 2: Create symlink (recommended)\nln -s $(pwd)/git-branch-manager.py ~/.local/bin/git-bm\n\n# Now you can run from anywhere\ngit-bm\n```\n\n### Alternative: Install as Git Alias\n\n```bash\n# Add as git alias\ngit config --global alias.bm '!python3 /path/to/git-branch-manager.py'\n\n# Now use as:\ngit bm\n```\n\n## Usage\n\n### Command Line Arguments\n\n```bash\n# Show version\ngbm --version\ngbm -v\n\n# Show help\ngbm --help\ngbm -h\n\n# Specify a different git repository directory\ngbm --directory /path/to/repo\ngbm -d /path/to/repo\n```\n\n### Basic Navigation\n- `↑/↓` or `j/k`: Navigate through branches\n- `Page Up/Page Down`: Navigate by page\n- `Home/End`: Jump to first/last branch\n- `Enter`: Checkout selected branch\n- `q` or `ESC`: Quit (ESC also clears filters)\n\n### Branch Operations\n- `D`: Delete selected branch (with confirmation)\n- `M`: Move/rename branch\n- `N`: Create new branch from current\n- `S`: Pop last stash (if available)\n\n### Filtering \u0026 Search\n- `/`: Search branches by name\n- `a`: Toggle author filter (show only your branches)\n- `o`: Toggle old branches filter (\u003e3 months)\n- `m`: Toggle merged branches filter\n- `p`: Filter by prefix (feature/, bugfix/, etc.)\n- `c`: Clear all filters\n\n### Remote \u0026 Browser\n- `t`: Toggle remote branches view\n- `f`: Fetch from remote\n- `b`: Open branch in browser\n- `B`: Open branch comparison/PR page\n- `r`: Reload branch list\n\n### Help\n- `?`: Show help screen\n\n## Configuration\n\nGit Branch Manager supports configuration via `~/.config/git-branch-manager/config.json`:\n\n```json\n{\n  \"platform\": \"auto\",              // auto-detect or: github, gitlab, bitbucket-cloud, bitbucket-server, custom\n  \"default_base_branch\": \"main\",   // default branch for comparisons\n  \"browser_command\": \"open\",       // command to open browser (open on macOS, xdg-open on Linux)\n  \"prevent_browser_for_merged\": false,  // prevent opening browser for merged branches (useful if remote deletes merged branches)\n  \"custom_patterns\": {             // for custom Git hosting platforms\n    \"branch\": \"https://git.example.com/{repo}/tree/{branch}\",\n    \"compare\": \"https://git.example.com/{repo}/compare/{base}...{branch}\"\n  }\n}\n```\n\n### Platform Detection\n\nThe tool automatically detects your Git hosting platform:\n- GitHub\n- GitLab\n- Bitbucket (Cloud \u0026 Server)\n- Azure DevOps\n- Custom platforms (via configuration)\n\n## Visual Indicators\n\n### Branch Status\n- `*` Current branch (highlighted in green)\n- `↓` Remote branch\n- `  ` Local branch\n\n### Branch State\n- `[modified]`: Has uncommitted changes\n- `[unpushed]`: Exists locally but not on remote\n- `[merged]`: Has been merged into main/master\n- `[worktree]`: Checked out in another worktree\n\n### Color Coding\n- **Green**: Current branch\n- **Cyan**: Branch names\n- **Yellow**: Modified indicator\n- **Magenta**: Recent branches (\u003c1 week)\n- **Blue**: Commit info\n- **Red**: Old branches (\u003e1 month)\n\n## Keyboard Shortcuts\n\n| Key | Action | Context |\n|-----|--------|---------|\n| `↑`/`↓` | Navigate branches | Always |\n| `j`/`k` | Navigate branches (Vim-style) | Always |\n| `PgUp`/`PgDn` | Navigate by page | Always |\n| `Home`/`End` | Jump to first/last | Always |\n| `Enter` | Checkout branch | Branch selected |\n| `D` | Delete branch | Local branch selected |\n| `M` | Move/rename branch | Branch selected |\n| `N` | New branch | Always |\n| `S` | Pop stash | Stash available |\n| `/` | Search | Always |\n| `a` | Author filter | Always |\n| `o` | Old branches filter | Always |\n| `m` | Merged filter | Always |\n| `p` | Prefix filter | Always |\n| `c` | Clear filters | Filters active |\n| `t` | Toggle remotes | Always |\n| `f` | Fetch | Always |\n| `r` | Reload | Always |\n| `b` | Open in browser | Branch selected |\n| `B` | Compare/PR | Branch selected |\n| `?` | Help | Always |\n| `q` | Quit | Always |\n| `ESC` | Clear filters/Quit | Always |\n\n## Examples\n\n### Daily Workflow\n\n```bash\n# Start branch manager\ngbm\n\n# Press 't' to see remote branches\n# Press '/' to search for a feature\n# Press Enter to checkout\n# Press 'N' to create new branch\n# Press 'D' to delete old branches\n```\n\n### Cleanup Old Branches\n\n```bash\ngbm\n# Press 'o' to hide old branches\n# Press 'm' to hide merged branches\n# Review remaining branches\n# Press 'D' on branches to delete\n```\n\n### Find Your Branches\n\n```bash\ngbm\n# Press 'a' to show only your branches\n# Navigate and manage your work\n```\n\n## Tips \u0026 Tricks\n\n1. **Quick Filter Clear**: Press `ESC` to clear all filters at once\n2. **Safe Stashing**: The tool remembers stashes it creates and shows them in the header\n3. **Worktree Safety**: Can't checkout branches that are active in other worktrees\n4. **Protected Branches**: Main and master branches require extra confirmation to delete\n5. **Remote Checkout**: Select a remote branch and press Enter to create a local tracking branch\n6. **Quick Browser**: Press 'b' to instantly view a branch on GitHub/GitLab/etc.\n\n## Troubleshooting\n\n### Common Issues\n\n1. **\"No branches found\"**\n   - Ensure you're in a Git repository\n   - Try pressing 'f' to fetch from remote\n\n2. **Colors not showing**\n   - Ensure your terminal supports colors\n   - Try setting `TERM=xterm-256color`\n\n3. **Can't delete remote branches**\n   - This is by design - only local branches can be deleted\n   - To remove remote branches, use standard git commands\n\n4. **Spinner not animating during fetch**\n   - Requires Python threading support\n   - Check Python installation\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n### Development Setup\n\n```bash\n# Clone your fork\ngit clone https://github.com/yourusername/git-branch-manager.git\ncd git-branch-manager\n\n# Create a branch\ngit checkout -b feature/your-feature\n\n# Make changes and test\npython3 git-branch-manager.py\n\n# Submit PR\n```\n\n## License\n\nMIT License - see LICENSE file for details\n\n## Acknowledgments\n\n- Inspired by interactive Git tools like lazygit and gitui\n- Built with Python's curses library\n- UI design influenced by nano and micro editors\n\n---\n\n**Note**: This tool is designed for local branch management. For advanced Git operations, please use the standard Git CLI.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaveschumaker%2Fgbm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaveschumaker%2Fgbm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaveschumaker%2Fgbm/lists"}