Skip to main content

clone-all-from-org

CLI tool to clone all repos from a given organization or user

Install into your Python project using pip install clone-all-from-org

Install as a CLI tool using pipx: pipx install clone-all-from-org.

What does this do?

For any given GitHub users or orgs (or yourself) this will enumerate all the repos you can see and clone them to a prefix. This allows you to keep up to date with any repos in the uses or orgs you follow.

This script requires a GitHub OAuth token, or Personal Access Token, to talk to the GitHub API. The easiest way to get one is to login with the GitHub CLI tool. This script knows how to read the token from that tool's config.

To run give it a list of orgs to clone:

clone-all-from-org me org:codinggrace user:micktwomey
# clones all the repos into ~/src/github.com/{organization or user}/{repo name}

This tool recognizes:

  • org:someorg - a GitHub organization
  • user:someuser - GitHub user
  • me - yourself

Note that the GitHub APIs will only show you publicly available repos for users and orgs by default. If you are a member of the organization you can see all repos (if you have access). me is a special case, this will show all repos you have access to (including your own private repos). If you used user:your-username it would only show your public repos.

Combining with gitup

This combines well with gitup to fetch all new repos and then update all your cloned repos:

# one off setup
pipx install gitup clone-all-from-org
gitup -a ~/src/github.com

# run periodically
clone-all-from-org me org:my-org
gitup --prune

GitHub Enterprise

You can override the default base URl with --base-url. This is most useful for accessing GitHub Enterprise servers.

Typically you'd need something like https://git.example.com/api/v3/ as a base URl for enterprise:

clone-all-from-org --base-url https://git.example.com/api/v3/ me

Metadata

Release files for clone-all-from-org 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clone-all-from-org 0.2.2
File Size Uploaded
clone-all-from-org-0.2.2.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clone-all-from-org 0.2.2
File Interpreter ABI Platform
clone_all_from_org-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 15.9 kB

Release files / clone-all-from-org-0.2.2.tar.gz

Download URL clone-all-from-org-0.2.2.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4874df9f6d6d5fd4dedbfbd4c4530ea8ab8c376a2032f41abc407d621b4939ae
BLAKE2b-256 checksum
How to use checksums
3349d8a729d1dc4b6fa86753ed7b1a845844ca7fcfe916398fb3523377319157
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.4 Darwin/21.4.0

Release files / clone_all_from_org-0.2.2-py3-none-any.whl

Download URL clone_all_from_org-0.2.2-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f687e8fdd2165b7e2a389a72cf8e3933b1ab99f522f4ac72bef0643d404f189
BLAKE2b-256 checksum
How to use checksums
11020475f7796fdd84245e729acc15411ea9349d117b14ebdcd196eb1a674cfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.4 Darwin/21.4.0

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page