{"id":29791734,"url":"https://github.com/koladilip/git-manager","last_synced_at":"2026-04-13T01:35:43.768Z","repository":{"id":304115641,"uuid":"1017803109","full_name":"koladilip/git-manager","owner":"koladilip","description":"A unified, context-aware CLI tool for managing and cloning multiple GitHub repositories across any number of organizations, with interactive selection, workspace automation, and smart autocomplete.","archived":false,"fork":false,"pushed_at":"2025-07-11T06:14:21.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-13T01:35:42.582Z","etag":null,"topics":["autocomplete","automation","cli","developer-tools","git","github","repository-management"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/koladilip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2025-07-11T05:59:59.000Z","updated_at":"2025-07-11T06:14:24.000Z","dependencies_parsed_at":"2025-07-11T10:09:43.283Z","dependency_job_id":"d3a7f002-9904-401c-8d46-8da3be244893","html_url":"https://github.com/koladilip/git-manager","commit_stats":null,"previous_names":["koladilip/git-manager"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/koladilip/git-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koladilip%2Fgit-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koladilip%2Fgit-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koladilip%2Fgit-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koladilip%2Fgit-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koladilip","download_url":"https://codeload.github.com/koladilip/git-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koladilip%2Fgit-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31736723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T22:19:12.206Z","status":"ssl_error","status_checked_at":"2026-04-12T22:18:33.088Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["autocomplete","automation","cli","developer-tools","git","github","repository-management"],"created_at":"2025-07-28T00:33:50.790Z","updated_at":"2026-04-13T01:35:43.748Z","avatar_url":"https://github.com/koladilip.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Management Tools\n\nThis folder contains a unified, context-aware CLI tool for managing multiple Git repositories with intelligent behavior.\n\n## 🛠️ Tool Overview\n\n### `git-manage` - Unified Git Repository Manager\nA comprehensive, context-aware CLI tool that adapts its behavior based on whether you're inside or outside a workspace. It combines repository discovery, workspace management, and interactive selection into a single powerful tool.\n\n**Key Features:**\n- 🎯 **Context-aware**: Different commands and behavior inside vs outside workspaces\n- 🔍 **Smart Discovery**: Global organization cache with auto-refresh\n- 📦 **Workspace Management**: Create and manage multi-repository workspaces\n- ⚡ **Interactive Selection**: Fuzzy search with multi-select using `fzf`\n- 🔄 **Auto-updates**: Laptop-friendly cron scheduling\n- 🏢 **Multi-org Support**: Manage repositories from multiple organizations\n- 🛠️ **Auto-install**: Automatic dependency installation with OS detection\n- **Default branch detection** (uses cache, GitHub API, or local fallback)\n- Autocomplete for commands and repo names (via completion script)\n\n## 📋 Prerequisites\n\nThis tool requires the following dependencies:\n\n- **git** - For repository operations\n- **gh** (GitHub CLI) - For fetching repository information\n- **fzf** - For interactive fuzzy selection\n\n### 🚀 Automatic Installation\nThe `install` command can automatically install missing dependencies and the tool itself:\n\n```bash\n./git-manage install\n```\n\nThis will:\n- ✅ Detect your operating system (macOS/Linux)\n- ✅ Check for missing dependencies\n- ✅ Offer to install them using your system's package manager\n- ✅ Install git-manage to `~/.local/bin`\n- ✅ Add `~/.local/bin` to your PATH\n\n### 🛠️ Manual Installation (if needed)\n\n#### macOS (using Homebrew)\n```bash\nbrew install git gh fzf\n```\n\n#### Ubuntu/Debian\n```bash\n# GitHub CLI\ncurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg\necho \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | sudo tee /etc/apt/sources.list.d/github-cli.list \u003e /dev/null\nsudo apt update\nsudo apt install git gh fzf\n```\n\n#### Authentication\nAfter installing GitHub CLI, authenticate with:\n```bash\ngh auth login\n```\n\n## 🚀 Quick Start\n\n### Installation Benefits\n- **System-wide access**: Available from any directory after installation\n- **Standard location**: Installs to `~/.local/bin` (Unix standard)\n- **No repository dependency**: Works even if the original repo is moved/deleted\n- **Easy updates**: Run `git-manage install` again to update\n\n### 1. One-command installation\n```bash\n./git-manage install\n```\nThis will:\n- Check and install missing dependencies (git, gh, fzf)\n- Install git-manage to `~/.local/bin`\n- Add `~/.local/bin` to your PATH in `~/.zshrc`\n- Check GitHub CLI authentication status\n\n### 2. Create a workspace\n```bash\ngit-manage create my-projects\ncd my-projects\n```\n\n### 3. Start adding repositories\n```bash\n# Interactive selection from your default orgs\ngit-manage clone\n\n# Or clone a specific repository\ngit-manage clone awesome-repo   # Uses your default orgs\ngit-manage clone github/cli     # org/repo format\ngit-manage clone https://github.com/user/repo.git\n```\n\n## 📖 Commands Reference\n\n### Global Commands (Available Everywhere)\n\n#### `install`\nInstall git-manage to ~/.local/bin and add to PATH\n```bash\ngit-manage install\n```\n\n#### `create \u003cworkspace\u003e`\nInitialize a new workspace with management scripts\n```bash\ngit-manage create my-projects\n```\n\n#### `clone [repo/org/url]`\n**Outside workspace**: Interactive picker or direct clone to current directory\n**Inside workspace**: Add to workspace and clone\n\n```bash\n# Interactive selection (outside workspace)\ngit-manage clone\n\n# Clone specific repo (outside workspace)  \ngit-manage clone cli/cli\n\n# Inside workspace - adds to workspace\ncd my-projects\ngit-manage clone awesome-repo\n```\n\n#### `import-org [org]`\nCache all repositories from an organization globally\n```bash\ngit-manage import-org microsoft\ngit-manage import-org  # uses your first default org\n```\n\n#### `list-orgs`\nShow all imported organizations\n```bash\ngit-manage list-orgs\n```\n\n#### `refresh-orgs`\nRefresh all cached organization data\n```bash\ngit-manage refresh-orgs\n```\n\n#### `setup-org-cron`\nSetup automatic refresh of organization data\n```bash\ngit-manage setup-org-cron\n```\n\n### Workspace Commands (Inside Workspace Only)\n\n#### `update`\nUpdate all repositories in the workspace\n```bash\ngit-manage update\n```\n\n#### `setup-cron`\nSetup automatic updates for the workspace\n```bash\ngit-manage setup-cron\n```\n\n#### `select-repos [org]`\nInteractive multi-select for adding repositories to workspace\n```bash\ngit-manage select-repos rudderlabs\ngit-manage select-repos  # uses your first default org\n```\n\n#### `sync`\nPull latest only if no local changes (uses correct default branch)\n```bash\ngit-manage sync\n```\n\n#### `reset`\nHard reset all repos to their default branch (shows which branch)\n```bash\ngit-manage reset\n```\n\n#### `reset-and-sync`\nReset all repos, then sync (pull latest)\n```bash\ngit-manage reset-and-sync\n```\n\n#### `upgrade`\nAdd missing scripts to workspace\n```bash\ngit-manage upgrade\n```\n\n## 🎯 Context-Aware Behavior\n\nThe tool automatically detects whether you're inside a workspace and adapts accordingly:\n\n### Outside Workspace\n- `clone` acts as a general-purpose repository picker\n- Focus on discovery and one-off cloning\n- Help shows global commands\n\n### Inside Workspace  \n- `clone` adds repositories to workspace state\n- Additional workspace management commands available\n- Help shows workspace-specific commands\n\n## 🏢 Multi-Organization Support\n\n### Default Organizations\n\nYou can set one or more default organizations. These are used for:\n- Autocomplete in `clone` and `select-repos` commands\n- The default org for interactive pickers\n- The default org when cloning by repo name only\n\n#### Setting/Changing Default Orgs\n\nYou will be prompted to set default orgs during installation. To change them later:\n\n```bash\ngit-manage config-orgs\n```\n- Enter a comma-separated list (e.g. `rudderlabs,microsoft,facebook`)\n- Press Enter to keep current settings\n- Type `clear` to remove all default orgs\n\n#### Example\n```bash\ngit-manage config-orgs\n# Default organizations: rudderlabs, microsoft\n```\n\n### Global Organization Cache\nOrganizations are cached globally in `~/.git-manage/`:\n```\n~/.git-manage/\n├── rudderlabs/\n│   └── repos.txt\n├── microsoft/\n│   └── repos.txt\n└── github/\n    └── repos.txt\n```\n\n- Autocomplete and interactive pickers work across all your configured default orgs.\n- You can add, remove, or change orgs at any time with `git-manage config-orgs`.\n\n## ⏰ Laptop-Friendly Scheduling\n\nBoth cron jobs use laptop-friendly times when your computer is likely to be on:\n\n### Workspace Updates (`setup-cron`)\n- 9:00 AM (weekdays) - Morning startup\n- 2:00 PM (daily) - Afternoon check  \n- 5:00 PM (weekdays) - Before end of day\n\n### Organization Data Refresh (`setup-org-cron`)\n- 9:00 AM (weekdays) - Morning startup\n- 1:00 PM (daily) - Lunch break\n- 6:00 PM (weekdays) - Evening wrap-up\n\n## 📁 Workspace Structure\n\nWhen you create a workspace, it creates:\n\n```\nworkspace-name/\n├── repos.txt          # List of cloned repositories\n├── clone_repos.sh     # Clone all repositories\n├── add_repo.sh        # Add and clone a repository\n├── update_repos.sh    # Update all repositories\n└── update.log         # Update logs (created after setup-cron)\n```\n\n## 🎮 Interactive Selection Controls\n\nWhen using `fzf` for repository selection:\n\n- **Arrow keys** or **typing**: Filter repositories\n- **Tab**: Select/deselect repositories (multi-select)\n- **Ctrl+A**: Select all filtered repositories\n- **Ctrl+D**: Deselect all repositories  \n- **Enter**: Confirm selection\n- **Esc**: Cancel selection\n\n### Display Format\n```\nrepo-name [Language] ⭐123 🔒 - Repository description\n```\n\n**Indicators:**\n- 🔒 - Private repository\n- ⭐ - Star count\n- [Language] - Primary programming language\n\n## 🔧 Troubleshooting\n\n### Common Issues\n\n1. **\"gh: command not found\"**\n   - Install GitHub CLI: https://cli.github.com/\n\n2. **\"fzf: command not found\"**\n   - Install fzf: https://github.com/junegunn/fzf#installation\n\n3. **\"Not authenticated with GitHub CLI\"**\n   - Run: `gh auth login`\n\n4. **\"Failed to fetch repositories\"**\n   - Check if the organization/user exists\n   - Verify you have access to the repositories\n   - Ensure GitHub CLI is authenticated\n\n5. **SSH key issues**\n   - Ensure your SSH key is added to GitHub\n   - Test with: `ssh -T git@github.com`\n\n### Debug Mode\nAdd `set -x` at the top of the script to see detailed execution.\n\n## 📝 Examples\n\n### Workflow 1: Setting up a new workspace\n```bash\n# Install tool globally\ngit-manage install\n\n# Create workspace\ngit-manage create my-projects\ncd my-projects\n\n# Import organization data\ngit-manage import-org rudderlabs\n\n# Interactively select repositories\ngit-manage select-repos\n\n# Setup automatic updates\ngit-manage setup-cron\n```\n\n### Workflow 2: One-off repository cloning\n```bash\n# Clone a specific repository\ngit-manage clone cli/cli\n\n# Interactive selection from organization\ngit-manage clone\n```\n\n### Workflow 3: Managing multiple organizations\n```bash\n# Import multiple organizations\ngit-manage import-org microsoft\ngit-manage import-org github\ngit-manage import-org rudderlabs\n\n# Setup automatic refresh\ngit-manage setup-org-cron\n\n# List all available organizations\ngit-manage list-orgs\n```\n\n## 🤝 Contributing\n\nFeel free to submit issues and pull requests to improve this tool!\n\n## 📄 License\n\nThis tool is provided as-is under the same license as the parent repository. \n\n## Shell Completion\n- Completion logic is in `~/.git-manage/completion.sh`\n- Your `.zshrc` or `.bashrc` only needs:\n  ```sh\n  source \"$HOME/.git-manage/completion.sh\"\n  ```\n- Autocomplete works for all commands and repo names (tab-completion)\n\n## Upgrading Existing Workspaces\nRun `git-manage upgrade` in any workspace to add missing scripts or update logic. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoladilip%2Fgit-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoladilip%2Fgit-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoladilip%2Fgit-manager/lists"}