This script downloads GitHub organization repositories and is useful if you have lots of repos you would like to clone
or pull --rebase
.
pip install -r requirements.txt
./DownloadRepos.py ansible --verbose
No authenticate needed
./DownloadRepos.py ansible --repos-file config.json
./DownloadRepos.py ansible --dry-run
./DownloadRepos.py ansible --repos-file config.json --dry-run
./DownloadRepos.py --repos-file config.json --dry-run
./DownloadRepos.py --update-list-only
Name | Description | Default Value |
---|---|---|
First Positional Argument | Repo Name Pattern | |
--config-file |
Configuration file | config.ini |
--repos-file |
Use previous JSON file | |
--update-list-only |
Update JSON file | |
--dont-rebase |
Don't pull rebase repos | False |
--stop-on-error |
Stop on error | False |
--dry-run |
Dry-run. No repos are downloaded | False |
--verbose |
Verbose output | False |
Section [github]
Key | Description | Default Value |
---|---|---|
org | Organization | |
github_token | GitHub_API_Token |
Section [auth]
Key | Description | Default Value |
---|---|---|
username | Username | |
password | Password | |
two_factor_auth | Use Two Factor Auth | True |
Section [local]
Key | Description | Default Value |
---|---|---|
repo_base_folder | local repo base path | . |
https://help.github.com/articles/creating-an-access-token-for-command-line-use/
flake8 DownloadRepos.py
Only tested on Mac OS X
File ./shell_profiles/.zshrc
contains a function called gitc
that can be used to clone a git repo into folder structure (<USERNAME>/<REPO_NAME>
) and then cd
into it.
e.g.
gitc git@github.com:jpnewman/download_repos.git
MIT / BSD
John Paul Newman