A clean and powerful Oh My Zsh plugin for managing Git repositories with submodules. This plugin provides essential utilities with an interactive, emoji-rich interface while maintaining simplicity and reliability.
- π― Simple & Reliable - Focused on core functionality that works
- π¨ Interactive UI - Beautiful emoji-rich interface with 4 menu modes
- π Smart Workflows - User-friendly prompts for complex operations
- π Visual Feedback - 4 progress indicator styles with real-time updates
- π‘οΈ Safe Operations - Dry-run preview, validation, and error handling
- π§ Stash Management - Automatic stash handling with timestamp-based naming
- βοΈ Auto-Update - Self-updating capability with interactive prompts
- π Verbose Control - Toggle detailed logging on/off with
toggle_verbose
- π Dynamic Detection - Works on ANY repository (no hardcoded submodule paths!)
- β‘ Parallel Operations - 3-5x faster operations with background execution
- ποΈ Configuration System - 13 customizable settings via interactive wizard
- π΄ CLI Flags - 10 standard flags (--help, --dry-run, --parallel, --json, etc.)
- π Shell Completion - Full tab completion for Zsh and Bash
- π JSON Output - CI/CD integration with structured data export
- π§ͺ Dry-Run Mode - Preview operations before execution
- βοΈ Atomic Operations - All-or-nothing commits with automatic rollback
- π Operation History - Track operations with undo capability
- π¨ Enhanced Menus - Arrow navigation, keyboard shortcuts, multi-select
- π Smart Commit - 10x faster analysis with single-pass optimization
- π¨ Theme System - 4 display modes (emoji, ansi, plain, minimal) for different terminals
- π‘ Enhanced Help - Comprehensive help system with tutorials, workflows, and command discovery
- β¨οΈ Command Aliases - 20+ built-in shortcuts + custom alias system
- β Better Errors - Contextual error messages with recovery suggestions and validation
- π Interactive Tutorial - Built-in beginner's guide and workflow patterns
- π Command Discovery - Search and list commands with
list_commandsandsearch_commands - β‘ Tab Completion - Intelligent auto-completion for commands, themes, and help topics
- π --help Flags - Quick help available on any command with
--helpor-h
-
Clone this repository:
git clone https://github.com/adishM98/git-submodules.git ~/.oh-my-zsh/custom/plugins/git-submodules -
Add the plugin to your
~/.zshrc:plugins=(... git-submodules)
-
Reload Zsh:
source ~/.zshrc
-
Clone the repository anywhere:
git clone https://github.com/adishM98/git-submodules.git
-
Source the plugin in your shell configuration:
source /path/to/git-submodules/git-submodules.plugin.zsh
An interactive terminal UI for visualizing git status across all submodules. Built with Ink.
Via NPM (Recommended):
npm install -g git-submodules-tui
gsm-tuiVia Plugin: The TUI is automatically available when you install the git-submodules plugin:
gsm-tui- π Visual status dashboard for base repo + all submodules
- π¨ 4 color themes (Dark, Light, Nord, Minimal)
- β¨οΈ Vim-style navigation (hjkl/arrows)
- π Auto-refresh every 2 seconds
- π― Status indicators (clean/dirty/conflicts)
- π Ahead/behind tracking info
- Node.js 14+
- zsh shell
cd /path/to/repo/with/submodules
gsm-tuiKeyboard shortcuts:
β/kandβ/j- Navigatet- Cycle themesr- Refreshh/?- Helpq/Esc- Quit
See tui/README.md for full documentation.
After installation, you can immediately start using commands like:
# Check plugin status and current repository
git_submodules_status
# Pull latest changes from all repositories
pull_all
# Pull with modern CLI flags
pull_all --parallel --jobs=8 --verbose
# Preview commit without executing
commit_all --dry-run "feat: new feature"
# Get JSON output for CI/CD
status_all --json | jq .
# Create a feature branch interactively
start_feature
# Configure the plugin interactively
configure_git_submodules
# Control logging verbosity
toggle_verboseThe plugin now includes a comprehensive configuration system:
# Run the interactive configuration wizard
configure_git_submodules
# View current configuration
show_git_submodules_config
# Reset to defaults
reset_git_submodules_configSettings are stored in ~/.config/git-submodules/config:
# Performance
parallel_enabled=false # Enable parallel operations
parallel_jobs=4 # Number of concurrent jobs
# User Interface
menu_style=numbered # Menu interaction: numbered, arrow, keyboard, both
progress_style=bar # Progress style: bar, spinner, dots, percentage
emoji_enabled=true # Use emoji in output
# Safety
atomic_commits=false # Enable all-or-nothing commits
dry_run_default=false # Preview operations by default
confirm_destructive=true # Confirm dangerous operations
# Caching
cache_enabled=true # Cache submodule list
cache_ttl=60 # Cache lifetime in seconds
# Output
verbose_mode=true # Show detailed output
quiet_mode=false # Minimal output
auto_stash=true # Automatically stash/apply changesAll commands now support modern CLI flags for flexibility:
# Help
pull_all --help # Show command help
# Execution Control
commit_all --dry-run "msg" # Preview without executing
push_all --force # Skip confirmations
pull_all --yes # Auto-confirm all prompts
# Output Control
status_all --quiet # Minimal output (errors only)
pull_all --verbose # Detailed output
status_all --json # JSON format for CI/CD
# Performance
pull_all --parallel # Use parallel execution
push_all --jobs=8 # Set parallel job count
# Scope Control
commit_all --scope=base "msg" # Base repository only
push_all --scope=subs # Submodules only
pull_all --scope=all # All repositories (default)# Dry-run commit to preview changes
add_all && commit_all --dry-run "feat: add user auth"
# Parallel pull with 8 jobs
pull_all --parallel --jobs=8 --verbose
# JSON status for CI/CD pipeline
status_all --json > status.json
# Quiet push with auto-confirm
push_all --quiet --yes --scope=subs| Command | Description | Example |
|---|---|---|
pull_all |
Pull changes for main repo and all submodules | pull_all |
push_all |
Push changes across all repositories | push_all |
add_all |
Stage changes in main repo and submodules | add_all |
commit_all "<message>" |
Commit changes across all repositories | commit_all "Fix authentication bug" |
status_all |
Show Git status for all repositories | status_all |
| Command | Description | Example |
|---|---|---|
checkout_all |
Interactive checkout with stash support | checkout_all |
create_branch_all <name> |
Create branch in all repositories | create_branch_all my-feature |
create_feature_all <name> |
Create feature/ prefixed branch |
create_feature_all user-auth |
create_hotfix_all <name> |
Create hotfix/ prefixed branch |
create_hotfix_all critical-fix |
create_release_all <name> |
Create release/ prefixed branch |
create_release_all v2.1.0 |
create_sprint_all <name> |
Create sprint/ prefixed branch |
create_sprint_all sprint-23 |
create_revamp_all <name> |
Create revamp/ prefixed branch |
create_revamp_all ui-redesign |
| Command | Description | Features |
|---|---|---|
start_branch |
Create branch with interactive selection | Choose repos, folders, or all |
start_feature |
Interactive feature branch creation | Guided prompts and validation |
start_hotfix |
Interactive hotfix branch creation | Smart repo selection |
start_release |
Interactive release branch creation | Comprehensive options |
start_sprint |
Interactive sprint branch creation | Flexible targeting |
| Command | Description | Features |
|---|---|---|
merge_all |
Interactive merge with stash handling | Smart conflict resolution |
create_tag_all <name> |
Create and push tags across repos | Validation and error handling |
| Command | Description | Safety |
|---|---|---|
atomic_commit_all "<msg>" |
Atomic commit with rollback on failure | Creates checkpoint, rolls back on error |
atomic_merge_all <branch> |
Atomic merge with rollback on failure | All repos succeed or all rolled back |
atomic_checkout_all <branch> |
Atomic checkout with rollback | Consistent state across all repos |
| Command | Description | Performance |
|---|---|---|
parallel_pull_all [jobs] |
Pull all repos in parallel | 3-5x faster than sequential |
parallel_push_all [jobs] |
Push all repos in parallel | Background execution |
parallel_fetch_all [jobs] |
Fetch all repos in parallel | Configurable job count |
parallel_status_all [jobs] |
Status check in parallel | Fast repository overview |
| Command | Description | Purpose |
|---|---|---|
git_submodules_history [count] |
Show recent operations | View last N operations |
git_submodules_undo [entry] |
Undo previous operation | Rollback commits, merges |
git_submodules_clear_history |
Clear operation history | Remove all history entries |
| Command | Description | Use Case |
|---|---|---|
git_submodules_checkpoint [name] |
Create manual checkpoint | Before risky operations |
git_submodules_restore [id] |
Restore from checkpoint | Recover from mistakes |
git_submodules_checkpoints |
List all checkpoints | View available restore points |
| Command | Description | Purpose |
|---|---|---|
generate_commit_message |
AI-like commit message suggestions | Smart conventional commits |
smart_commit_all |
Complete smart commit workflow | Automated commit with analysis |
resolve_submodule_conflicts |
Interactive submodule conflict resolution | Fix merge conflicts easily |
| Command | Description | Purpose |
|---|---|---|
git_submodules_status |
Show plugin and repository status | Debug and overview |
toggle_verbose |
Control output verbosity | Customize logging |
update_git_submodules_plugin |
Update plugin to latest version | Auto-update |
The plugin still supports legacy environment variables:
# Control output verbosity (default: true)
export GIT_SUBMODULES_VERBOSE=trueNote: For the modern configuration system with 13+ settings, see the Modern Configuration section above.
checkout_all
# Interactive prompts with emoji interface:
# πΏ Enter the branch name to checkout: feature-branch
#
# π― Where do you want to checkout the 'feature-branch' branch?
# 1οΈβ£ π Base repository
# 2οΈβ£ π¦ Submodule repositories
# 3οΈβ£ π Both (Base + Submodules)
# 4οΈβ£ ππΎ Both (Base + Submodules) with Stash Handling
# π€ Enter your choice (1/2/3/4): 4Features:
- β Automatic stash handling for uncommitted changes
- β Smart upstream tracking and pulling
- β Visual progress indicators with emojis
- β Graceful error handling
merge_all
# Interactive prompts with visual interface:
# π³ Enter the base branch to merge from: main
#
# π― Where do you want to merge 'main' into 'feature-branch'?
# 1οΈβ£ π Base repository
# 2οΈβ£ π¦ Submodule repositories
# 3οΈβ£ π Both (Base + Submodules)
# 4οΈβ£ ππΎ Both (Base + Submodules) with Stash Handling
# π€ Enter your choice (1/2/3/4): 2
#
# π¦ Which submodule(s) do you want to merge into?
# 1οΈβ£ πΉ frontend/ee
# 2οΈβ£ πΉ server/ee
# 3οΈβ£ π Both
# π€ Enter your choice (1/2/3): 3Features:
- π Flexible submodule selection with visual indicators
- πΎ Automatic stash management before/after merge
- π Real-time progress feedback with emojis
- π‘οΈ Pre-merge validation and fetching
start_feature
# Interactive branch creation with visual prompts:
# πΏ Enter feature branch name: user-authentication
#
# π― Where do you want to create the 'user-authentication' branch?
# 1οΈβ£ π Base repository
# 2οΈβ£ π¦ Submodule repositories
# 3οΈβ£ π Specific folders
# 4οΈβ£ π All (Base + Submodules)
# π€ Enter your choice (1/2/3/4): 4
#
# βΉοΈ π Creating branch 'user-authentication' in base repository and submodules...
# β
π Branch 'user-authentication' created successfully!smart_commit_all
# AI-like commit message generation:
# π§ === Smart Commit Workflow === π§
# βΉοΈ Found staged changes in base repository
#
# π€ === Smart Commit Message Generator === π€
# π Files changed: 3
#
# π‘ Suggested commit messages:
# 1οΈβ£ feat(frontend): add new functionality
# 2οΈβ£ feat(frontend): auth-component
#
# π Recent commit patterns:
# πΈ fix: resolve login bug
# πΈ feat: add user dashboard
#
# π― File summary:
# β
Added: 1 files
# π Modified: 2 files
#
# π Choose an option:
# 1οΈβ£ Use suggested message #1
# 2οΈβ£ Use suggested message #2
# 3οΈβ£ π Write custom message
# 4οΈβ£ π Show detailed diff first
# 5οΈβ£ π« Cancel
# π€ Enter your choice (1/2/3/4/5): 1
#
# π Using: feat(frontend): add new functionality
# π Proceeding with commit...Features:
- π€ Automatic Analysis - Detects file types and suggests appropriate commit types
- π Conventional Commits - Follows standard commit message format
- π― Smart Scoping - Auto-detects scope based on directory structure
- π Pattern Learning - Shows recent commits to maintain consistency
- π File Summary - Clear overview of added/modified/deleted files
resolve_submodule_conflicts
# Specialized submodule conflict assistant:
# π§ === Submodule Conflict Resolution Assistant === π§
#
# π Conflict Analysis:
# ποΈ Submodule conflicts: 2
# π Regular file conflicts: 0
#
# π― Submodule Conflicts Found:
# 1οΈβ£ π¦ frontend/ee
# π Current (HEAD): a1b2c3d4
# π Incoming: e5f6g7h8
# 2οΈβ£ π¦ server/ee
# π Current (HEAD): x1y2z3a4
# π Incoming: b5c6d7e8
#
# π οΈ Resolution Options:
# 1οΈβ£ π Show detailed conflict info for each submodule
# 2οΈβ£ π Keep current version (HEAD) for all submodules
# 3οΈβ£ π Accept incoming version (MERGE_HEAD) for all submodules
# 4οΈβ£ π― Resolve each submodule individually
# 5οΈβ£ π Update submodules to latest commits
# 6οΈβ£ π« Abort merge
# π€ Enter your choice (1/2/3/4/5/6): 4Features:
- π― Submodule-Specific - Focuses specifically on submodule conflicts
- π Smart Analysis - Distinguishes between submodule and file conflicts
- π Detailed Info - Shows commit hashes and messages for each conflict
- π¨ Multiple Strategies - Batch resolution or individual handling
- π Latest Updates - Option to update to newest commits
Atomic operations ensure all-or-nothing consistency across repositories:
# Atomic commit - if ANY repo fails, ALL are rolled back
atomic_commit_all "feat: add user authentication"
# Success output:
# βοΈ === Atomic Commit (All-or-Nothing) ===
# πΈ Creating checkpoint...
# πΎ Committing base repository...
# π¦ Committing submodules...
# β
All repositories committed successfully
# Failure output (automatic rollback):
# β === Atomic Commit Failed ===
# π Base repository: Failed
# π¦ frontend/ee: Failed
# π Rolling back all changes...
# β Atomic commit failed and rolled back
# Atomic merge with automatic rollback on conflicts
atomic_merge_all main
# Atomic checkout - all repos switch or none do
atomic_checkout_all feature-branchExecute operations across multiple repos simultaneously:
# Pull all repos in parallel (3-5x faster)
parallel_pull_all
# Specify number of parallel jobs
parallel_pull_all 8
# Parallel push with 4 concurrent operations
parallel_push_all 4
# Fast status check across all repos
parallel_status_all
# Performance comparison
benchmark_parallel_vs_sequential pull
# Output:
# π === Performance Benchmark: pull ===
# β±οΈ Sequential execution...
# β‘ Parallel execution...
# π Results:
# Sequential: 12s
# Parallel: 3s
# Speedup: 4.00x fasterTrack and undo operations:
# View recent operations
git_submodules_history
# Output:
# π === Recent Operations (last 10) ===
# 1. [2025-01-15 14:30:00] β
commit_all "feat: add auth"
# 2. [2025-01-15 14:25:00] β
merge_all main
# 3. [2025-01-15 14:20:00] β
checkout_all feature-branch
# Undo last commit
git_submodules_undo 1
# Interactive confirmation:
# β οΈ Undo Operation
# Operation: commit_all "feat: add auth"
# Time: 2025-01-15 14:30:00
#
# Continue with undo? (y/N): y
#
# π Undoing last commit...
# β
Commit undone in all repositories
# Clear all history
git_submodules_clear_historyCreate restore points before risky operations:
# Create checkpoint before dangerous operation
git_submodules_checkpoint "before-refactor"
# Perform risky changes...
# ... something goes wrong ...
# List available checkpoints
git_submodules_checkpoints
# Output:
# π === Available Checkpoints ===
# 1. [2025-01-15 15:00:00] before-refactor
# 2. [2025-01-15 14:30:00] commit_all
# Restore from checkpoint
git_submodules_restore before-refactor
# Output:
# π === Restoring Checkpoint: before-refactor ===
# π Restoring base repository to main @ a1b2c3d
# π¦ Restoring frontend/ee to main @ e5f6g7h
# π¦ Restoring server/ee to main @ x1y2z3a
# β
Checkpoint restored successfullyPreview operations before executing:
# Preview commit without executing
commit_all --dry-run "feat: add new feature"
# Output:
# π === DRY-RUN: commit_all ===
# π Preview:
# Message: "feat: add new feature"
#
# π Base Repository:
# π src/auth.js (modified)
# β
src/utils.js (added)
#
# π¦ Submodules:
# πΈ frontend/ee
# π components/Login.jsx (modified)
# πΈ server/ee
# β
routes/auth.js (added)
#
# βΉοΈ This is a dry-run. No changes were made.
# Preview merge
merge_all --dry-run
# Preview with verbose output
pull_all --dry-run --verboseExport structured data for automation:
# Get status as JSON
status_all --json
# Output:
# {
# "base": {
# "branch": "main",
# "status": "M src/app.js",
# "ahead": 2,
# "behind": 0
# },
# "submodules": [
# {
# "path": "frontend/ee",
# "branch": "main",
# "status": "",
# "ahead": 1,
# "behind": 0
# }
# ]
# }
# Use in CI/CD pipeline
status_all --json | jq '.base.ahead' > commits_ahead.txt
# Check for uncommitted changes in CI
if status_all --json | jq -e '.base.status != ""' > /dev/null; then
echo "Uncommitted changes detected"
exit 1
fi
# List submodules as JSON
git_submodules_list --json | jq '.submodules[].path'Multiple interaction modes for different preferences:
# Configure menu style
configure_git_submodules
# Arrow navigation mode
# Use β/β to navigate, Enter to select
# Keyboard shortcuts mode
# Press letter keys for quick selection
# Combined mode
# Use both arrows and keyboard shortcuts
# Multi-select mode (space to toggle, enter to confirm)
# Select multiple repos/submodules at once- Branch name validation - Ensures valid Git branch names
- Directory validation - Confirms paths exist before operations
- Git repository validation - Checks for valid Git repositories
- Error recovery - Graceful handling of failures
- Automatic detection - Only stashes when there are changes
- Branch-specific stashing - Uses descriptive stash messages
- Intelligent recovery - Applies correct stash after operations
- Clean handling - No orphaned stashes
git_submodules_status
# Visual status display:
# π§ === Git Submodules Plugin Status === π§
# π Plugin Directory: /path/to/plugin
# π Verbose Mode: true
# π Current Repository: β
Valid Git Repository
# π¦ Submodules Found: 2
# πΈ frontend/ee
# πΈ server/eestatus_all
# Visual status output:
# π === Base Repository Status ===
# ## main...origin/main
# M src/app.js
#
# π¦ === Submodule Status ===
# πΈ === frontend/ee ===
# ## feature-branch
# M components/Auth.jsx
#
# πΈ === server/ee ===
# ## feature-branch
# ?? new-endpoint.jsThe plugin can update itself:
update_git_submodules_plugin
# Interactive update experience:
# π Checking for updates for git-submodules plugin...
# β¨ A new update is available for git-submodules plugin.
# π€ Do you want to update? (y/N): y
# β¬οΈ Updating git-submodules plugin...
# β
π Update complete!
# π Would you like to reload Zsh now? (y/N): y
# π Reloading Zsh..."Not a git repository" error:
# Ensure you're in the base repository
cd /path/to/your/main/repo
git_submodules_status # Verify repository statusSubmodules not detected:
# Check if submodules are properly initialized
git submodule status
git submodule update --init --recursiveBranch creation failures:
# Enable verbose mode for detailed information
toggle_verbose
start_feature # Try creating branch with verbose outputStash conflicts:
# Check existing stashes
git stash list
# Apply specific stash manually if needed
git stash pop stash@{0}# Enable comprehensive logging
toggle_verbose
git_submodules_status # Check plugin status-
Start with status check:
git_submodules_status status_all
-
Use interactive commands for complex operations:
start_feature # Interactive branch creation checkout_all # Interactive checkout with stash handling merge_all # Interactive merge with stash support
-
Regular maintenance:
pull_all # Stay synchronized update_git_submodules_plugin # Keep plugin updated
- β Always run from the base repository (main repo containing submodules)
- β Commit or stash changes before major operations
- β Verify submodule status before bulk operations
- β Use interactive commands for complex workflows
- β Keep backups of important work
The plugin now supports customizable themes and configuration!
export GIT_SUBMODULES_THEME="emoji" # emoji, ansi, plain, minimal
export GIT_SUBMODULES_VERBOSE="true" # true, false
export GIT_SUBMODULES_COLOR="auto" # auto, always, neverset_theme ansi # ANSI colors with ASCII icons
set_theme plain # Plain text (accessibility mode)
set_theme minimal # Ultra-minimal output
set_theme emoji # Rich emoji icons (default)configure_git_submodules # Interactive configuration wizard
show_config # View current settingsThe plugin includes a comprehensive help system:
help # Show all commands
help tutorial # Beginner's step-by-step guide
help workflows # Common workflow patterns
help <command> # Detailed command help
<command> --help # Quick help for any command
# Discovery
list_commands # List all commands by category
search_commands commit # Search commands by keyword# Core operations
pall # pull_all
phall # push_all
aall # add_all
call # commit_all
sall # status_all
# Interactive workflows
gfeat # start_feature
gfix # start_hotfix
grel # start_release
# Smart features
scommit # smart_commit_all
fixsub # resolve_submodule_conflicts
# Utility
gsmstatus # git_submodules_status
gsmhelp # help
gsmtheme # set_themeadd_alias mywork "start_feature && echo 'Ready!'"
list_aliases
remove_alias mywork- All user inputs are validated and sanitized
- Commands use proper parameter handling to prevent issues
- Directory validation prevents path problems
- Git operations are executed safely with error handling
This plugin focuses on:
- Simplicity - Clean, understandable code
- Reliability - Proven functionality that works
- User Experience - Interactive prompts and clear feedback
- Safety - Input validation and error handling
- Maintainability - Easy to understand and extend
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
To remove the plugin:
-
Remove it from your
.zshrcplugins list:plugins=( ... ) # Remove 'git-submodules' from the list -
Delete the plugin directory:
rm -rf ~/.oh-my-zsh/custom/plugins/git-submodules -
Reload Zsh:
source ~/.zshrc