Skip to content

EaphoneTech/clone-all-repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clone-all-repo

a python utility that clones multiple git repo, and optionally push to another location.

Requirements

  • python3
  • git (must be installed in PATH)

Arguments

Usage: main.py [OPTIONS] [CONFIG_FILE]

  批量 clone 和 push git 仓库

  CONFIG_FILE 默认是 repos.yaml

  -o, --output-dir DIRECTORY  本地 git 仓库的路径  [default: repos]
  -p, --parallel INTEGER      并行处理的数量  [default: 1]
  --progress / --no-progress  是否显示进度条  [default: progress]
  -v, --verbose               是否打印更详细的日志
  --help                      Show this message and exit.

Configuration

Configuration is done by repos.yaml:

#repos.yaml

repos:
- repo: github/<github_org_name>/<github_repo_name>
  to: cnb/<cnb_org_name>/<cnb_sub_org_name>/<cnb_repo_name>
- repo: coding/<coding_team_name>/<coding_project_name>/<coding_repo_name>
  to: https://xxx.xxx/xxx.git

All repo s in the repos section will be git cloned to local.

Any repo with to will be git pushed to specified remote.

How to use

Run with cloned repo

  1. clone this repo
  2. put repos.yaml into cloned folder
  3. run python scripts/main.py

Run with uv

Put repos.yaml into any folder, and run:

$ uvx --from git+https://github.com/EaphoneTech/clone-all-repo.git clone-all-repo

Install using uv

$ uv tool install --from git+https://github.com/EaphoneTech/clone-all-repo.git clone-all-repo

Once installed, you can run clone-all-repo in any folder.

Upgrade with uv

$ uv tool upgrade clone-all-repo

Run with docker

TBD.

$ docker run -v $(pwd):/app -w /app biggates/clone-all-repo:latest

About

a python utility that clones multiple git repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published