ghcloneall

raw JSON →
1.12.0 verified Sat May 09 auth: no python

Clone or update all repositories for a GitHub user or organization. Current version: 1.12.0. Release cadence: infrequent, stable.

pip install ghcloneall
error ModuleNotFoundError: No module named 'ghcloneall'
cause The library is not installed.
fix
Run pip install ghcloneall.
error Git command failed: git clone ...
cause Git is not installed or not in PATH, or the repository URL is invalid.
fix
Install Git from https://git-scm.com/ and ensure it is available in your system PATH.
error 406 Client Error: Not Acceptable for url: https://api.github.com/...
cause Missing or invalid GitHub token, or API version mismatch.
fix
Provide a valid GitHub token via the github_token parameter or GITHUB_TOKEN environment variable.
gotcha Without a GITHUB_TOKEN, unauthenticated requests are heavily rate-limited. For large orgs or many repos, provide a token via environment variable or parameter.
fix Set the GITHUB_TOKEN environment variable or pass it as a parameter to functions that accept it.
gotcha The `skip_existing` parameter defaults to False. If you run `clone_user` without it, existing directories will cause an error.
fix Always pass `skip_existing=True` unless you want to overwrite existing repos.
gotcha The library uses the GitHub API; a '404' may occur if the user/org doesn't exist or you lack access. The error message may not be clear.
fix Verify the GitHub username/organization exists and that your token (if used) has the correct permissions.

Clone or update all repositories for a GitHub user or organization.

import ghcloneall

# Clone all repos for user 'octocat', skipping existing ones
ghcloneall.clone_user('octocat', skip_existing=True)

# Update all repos (pull) for an organization
token = os.environ.get('GITHUB_TOKEN', '')
ghcloneall.update_organization('my-org', skip_existing=True, github_token=token)