A tool to clone efficiently all the repos in an organization
Project description
cloner
A tool to clone efficiently all the repos in an organization
Install
In PyPi it's called wr-cloner, cloner was already taken :sad:
pip install wr-cloner
Usage
Note: If using cloner after cloning the project and not a PyPi package, add "python" at the start. There's an example of that in the examples section.
Usage: cloner [OPTIONS] GITHUB_ORGANIZATION
A tool to clone efficiently all the repos in an organization.
Options:
--version Show the version and exit.
--token TEXT GitHub token to read private repos. This
parameter is needed when cloning from a
GitHub Enterprise server.
--ghe TEXT GitHub Enterprise URL. It needs the
GITHUB_ORGANIZATION parameter to clone repos
from there and the TOKEN option as well.
--threads INTEGER Number of threads and processes to use. For
maximum threads and processes on the system,
use '--max-threads' [default: 4]
--max-threads If declared, uses the maximum available
threads and processes in the system. As per
physical cores on the system cpu.
--logging [ERROR|WARNING|INFO|DEBUG]
Logging level [default: INFO]
--path TEXT Sets a path where to clone the repositories
(eg: ./another/path/)
--git-options TEXT Add options to the clone command (eg: --git-
options "--depth 1"). By default, clones
quietly (--quiet).
--ignore-archived If declared, will ignore archived repos when
cloning.
--ignore-template If declared, will ignore template repos when
cloning.
--ignore-fork If declared, will ignore fork repos when
cloning.
--exclude-repos TEXT Comma separated list of repository names to
exclude from cloning. Example:
"repository1,repository2".
--help Show this message and exit.
Examples
# For github.com with 8 threads
cloner --threads 8 GITHUB_ORGANIZATION
# For github.com with the maximum threads on the system running
cloner --max-threads GITHUB_ORGANIZATION
# For GHE, default threads
cloner --ghe GHE_URL --token SUPER_SECURE_TOKEN GITHUB_ORGANIZATION
# Cloning with options
cloner --git-options "--depth 1" GITHUB_ORGANIZATION
Examples if cloning the repo
# Install dependencies with
make install
# Adjust PYTHONPATH
export PYTHONPATH=$PYTHONPATH:.
# Use it
python cloner GITHUB_ORGANIZATION
Contributing
Check the CONTRIBUTING.md file.
Security
Follow the instructions in the SECURITY.md file.
License
Known Issues
- Multithreading doesn't work to clone repos, since the
os.systemcall is 1 for each PID. The splitting is done with multithreading, the cloning with multiprocessing. Same amount of threads and processes. - Windows usage and support
- If seeing
RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)either adjust your git config, as per this StackOverflow issue. If still persists, either decrease the number of threads using the--threadsoption or adjust the depth of cloning with--git-options "--depth 10"(10 or any other small number).
Star History
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wr_cloner-1.10.1.tar.gz.
File metadata
- Download URL: wr_cloner-1.10.1.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dd623ef13f3c5690549623d0257fdda52764f8948255192b0bb0d86eb16bd74
|
|
| MD5 |
b527f855a4640cee6686b8a65e49f3c7
|
|
| BLAKE2b-256 |
4c319686e5121e9c4372542d2123d870017cb6c5c061c4749e4e962e320c8507
|
Provenance
The following attestation bundles were made for wr_cloner-1.10.1.tar.gz:
Publisher:
publish-release.yml on w0rmr1d3r/cloner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wr_cloner-1.10.1.tar.gz -
Subject digest:
7dd623ef13f3c5690549623d0257fdda52764f8948255192b0bb0d86eb16bd74 - Sigstore transparency entry: 738034062
- Sigstore integration time:
-
Permalink:
w0rmr1d3r/cloner@2e0091796e311931a8da1a839e64eb91202c5c06 -
Branch / Tag:
refs/tags/1.10.1 - Owner: https://github.com/w0rmr1d3r
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-release.yml@2e0091796e311931a8da1a839e64eb91202c5c06 -
Trigger Event:
release
-
Statement type:
File details
Details for the file wr_cloner-1.10.1-py3-none-any.whl.
File metadata
- Download URL: wr_cloner-1.10.1-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55c33f70289ce21bb92c4ced7c9ab79f8e0aacb9053f623dbe1542802172eebc
|
|
| MD5 |
3a2bab66dbb1ed67654cfb3f9cc8c867
|
|
| BLAKE2b-256 |
0d78bce2b158c18becfc7886f4df547a99979ef09f670420ec50a56b4831e15c
|
Provenance
The following attestation bundles were made for wr_cloner-1.10.1-py3-none-any.whl:
Publisher:
publish-release.yml on w0rmr1d3r/cloner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wr_cloner-1.10.1-py3-none-any.whl -
Subject digest:
55c33f70289ce21bb92c4ced7c9ab79f8e0aacb9053f623dbe1542802172eebc - Sigstore transparency entry: 738034087
- Sigstore integration time:
-
Permalink:
w0rmr1d3r/cloner@2e0091796e311931a8da1a839e64eb91202c5c06 -
Branch / Tag:
refs/tags/1.10.1 - Owner: https://github.com/w0rmr1d3r
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-release.yml@2e0091796e311931a8da1a839e64eb91202c5c06 -
Trigger Event:
release
-
Statement type: