{"id":42770786,"url":"https://github.com/xbglowx/github-org-repos-sync","last_synced_at":"2026-02-09T00:06:44.607Z","repository":{"id":57636232,"uuid":"426111717","full_name":"xbglowx/github-org-repos-sync","owner":"xbglowx","description":"Sync Github Organization Repositories","archived":false,"fork":false,"pushed_at":"2025-12-04T12:32:24.000Z","size":191,"stargazers_count":5,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-07T20:33:05.870Z","etag":null,"topics":["bulk-clone","git-automation","github","github-sync","org","organization","repos","repositories","repository-backup","sync"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xbglowx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2021-11-09T06:08:35.000Z","updated_at":"2025-12-04T12:32:06.000Z","dependencies_parsed_at":"2023-11-28T17:29:33.699Z","dependency_job_id":"b548d116-e210-4d49-8083-1cae0ae29420","html_url":"https://github.com/xbglowx/github-org-repos-sync","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/xbglowx/github-org-repos-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xbglowx%2Fgithub-org-repos-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xbglowx%2Fgithub-org-repos-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xbglowx%2Fgithub-org-repos-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xbglowx%2Fgithub-org-repos-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xbglowx","download_url":"https://codeload.github.com/xbglowx/github-org-repos-sync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xbglowx%2Fgithub-org-repos-sync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28886578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: 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":["bulk-clone","git-automation","github","github-sync","org","organization","repos","repositories","repository-backup","sync"],"created_at":"2026-01-29T21:43:51.329Z","updated_at":"2026-01-29T21:43:51.396Z","avatar_url":"https://github.com/xbglowx.png","language":"Go","readme":"# github-org-repos-sync\n\n[![Build and Test](https://github.com/xbglowx/github-org-repos-sync/actions/workflows/build-test.yaml/badge.svg)](https://github.com/xbglowx/github-org-repos-sync/actions/workflows/build-test.yaml) [![golangci-lint](https://github.com/xbglowx/github-org-repos-sync/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/xbglowx/github-org-repos-sync/actions/workflows/golangci-lint.yml) [![CodeQL](https://github.com/xbglowx/github-org-repos-sync/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/xbglowx/github-org-repos-sync/actions/workflows/codeql-analysis.yml) [![Release](https://github.com/xbglowx/github-org-repos-sync/actions/workflows/create-release.yaml/badge.svg)](https://github.com/xbglowx/github-org-repos-sync/actions/workflows/create-release.yaml)\n\nA command-line tool to efficiently sync all repositories from a GitHub organization to your local machine. Perfect for developers who need to maintain local copies of multiple repositories for backup, analysis, or bulk operations. \n\n## Features\n\n- **Bulk Repository Sync**: Clone or update all repositories from a GitHub organization in one command\n- **Smart Updates**: Automatically switches to default branch and pulls latest changes\n- **Dirty Repository Handling**: Safely stashes uncommitted changes before updating\n- **Parallel Processing**: Configurable concurrency for faster synchronization\n- **Repository Filtering**: Include/exclude specific repositories by name pattern\n- **Archived Repository Support**: Option to skip archived repositories\n- **Permission Aware**: Automatically skips repositories without pull permissions\n- **Empty Repository Handling**: Gracefully handles empty repositories without errors\n\n## Installation\n\n### Download Pre-built Binaries\n\nDownload the latest release for your platform from the [releases page](https://github.com/xbglowx/github-org-repos-sync/releases).\n\n### Build from Source\n\n1. **Clone the repository**:\n   ```bash\n   git clone git@github.com:xbglowx/github-org-repos-sync.git\n   cd github-org-repos-sync\n   ```\n\n2. **Build using Makefile**:\n   ```bash\n   # Build for current platform\n   make build\n   \n   # Build for all platforms (cross-compilation)\n   make build-all\n   \n   # Run tests\n   make test\n   \n   # Clean build artifacts\n   make clean\n   \n   # Show available targets\n   make help\n   ```\n\nThe Makefile automatically handles version detection from git tags/commits and provides convenient targets for building, testing, and cross-compilation.\n\n## Prerequisites\n\n### Authentication\n\n1. **GitHub Personal Access Token**: Create a token with `repo` scope\n   ```bash\n   export GITHUB_TOKEN=\u003cyour-token\u003e\n   ```\n\n2. **Git CLI Authentication**: Ensure `git` is authenticated with GitHub (SSH keys or credential helper)\n\n## Usage\n\n### Basic Syntax\n\n```bash\n./github-org-repos-sync \u003corganization\u003e -d \u003cdestination-path\u003e [options]\n```\n\n### Examples\n\n#### Sync all repositories from an organization\n```bash\n./github-org-repos-sync myorg -d ~/repos/myorg\n```\n\n#### Sync with custom parallelism (faster for large organizations)\n```bash\n./github-org-repos-sync myorg -d ~/repos -p 5\n```\n\n#### Skip archived repositories\n```bash\n./github-org-repos-sync myorg -d ~/repos --skip-archived\n```\n\n#### Filter repositories (include only those containing \"api\")\n```bash\n./github-org-repos-sync myorg -d ~/repos --include \"api\"\n```\n\n#### Exclude specific repositories (skip test repos)\n```bash\n./github-org-repos-sync myorg -d ~/repos --exclude \"test\"\n```\n\n#### Backup an entire organization\n```bash\n./github-org-repos-sync mycompany -d ~/backups/mycompany-repos\n```\n\n#### Sync only service repositories\n```bash\n./github-org-repos-sync mycompany -d ~/services --include \"service\"\n```\n\n#### Show help\n```bash\n./github-org-repos-sync --help\n```\n\n#### Check version\n```bash\n# Using version subcommand\n./github-org-repos-sync version\n\n# Using version flag\n./github-org-repos-sync --version\n./github-org-repos-sync -v\n```\n\n## How It Works\n\n1. **Repository Discovery**: Fetches a list of all repositories in the specified organization that you have access to\n2. **Local Check**: Determines if each repository already exists locally\n3. **Clone or Update**:\n   - **New repositories**: Clones them to the destination path\n   - **Existing repositories**: \n     - Fetches latest changes from remote\n     - Stashes uncommitted changes if the working directory is dirty\n     - Switches to the repository's default branch\n     - Pulls latest changes with rebase\n4. **Parallel Processing**: Processes multiple repositories concurrently for improved performance\n5. **Error Handling**: Gracefully handles edge cases like empty repositories, missing branches, and permission issues\n\n## Development\n\n### Makefile Targets\n\nThe project includes a Makefile with convenient targets for development:\n\n| Target | Description |\n|--------|-------------|\n| `make build` | Build binary for current platform |\n| `make build-all` | Build binaries for all platforms (linux/darwin/windows × amd64/arm64) |\n| `make test` | Run tests with race detection |\n| `make clean` | Clean build artifacts |\n| `make version` | Show version that would be built |\n| `make info` | Show detailed build information |\n| `make help` | Show all available targets |\n\n**Version Handling**: The Makefile automatically detects versions using:\n- Git tags for release builds (e.g., `v1.0.0`)\n- Git commit SHA for development builds (e.g., `a1b2c3d`)\n- `-dirty` suffix when there are uncommitted changes\n\n## Command Line Options\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `-d, --dest` | Destination directory for repositories | Required |\n| `-p, --parallelism` | Number of concurrent operations | 1 |\n| `--skip-archived` | Skip archived repositories | false |\n| `--include` | Include only repositories containing this string | \"\" |\n| `--exclude` | Exclude repositories containing this string | \"\" |\n| `-h, --help` | Show help message | - |\n\n## Troubleshooting\n\n### Permission Issues\n- Ensure your GitHub token has `repo` scope\n- Verify you have access to the organization\n- Check that git CLI is properly authenticated\n\n### Network Issues\n- The tool will retry failed operations\n- Use lower parallelism (`-p 1`) for unstable connections\n\n### Large Organizations\n- Consider using filters (`--include`/`--exclude`) for large organizations\n- Monitor disk space when syncing many repositories\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxbglowx%2Fgithub-org-repos-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxbglowx%2Fgithub-org-repos-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxbglowx%2Fgithub-org-repos-sync/lists"}