克隆/更新所有用户/组织github存储库
ghcloneall的Python项目详细描述
Ghcloneall
这是一个从github克隆/更新用户/组织的所有repo的脚本。
目标受众:大型项目集合的维护者(例如, ZopeFoundation成员)。
用法示例
首先,pip安装ghcloneall
克隆所有mgedmin的vim插件:
mkdir ~/src/vim-plugins cd ~/src/vim-plugins ghcloneall --init --user mgedmin --pattern '*.vim' ghcloneall
克隆所有ZopeFoundation存储库:
mkdir ~/src/zf cd ~/src/zf ghcloneall --init --org ZopeFoundation ghcloneall
下面是上面的一个截图(运行一个稍旧的版本,以便 脚本名称不同:
详细信息
它的功能:
- 克隆本地没有的存储库
- 提取本地已有存储库的更改
-
警告您有关本地更改和其他意外情况:
- 树中的未知文件(仅在详细模式下)
- 分阶段但未提交的更改
- 未承诺(和未时效的更改)
- 非主分行已签出
- 提交的更改尚未推送到主服务器
- 指向意外位置的远程URL(仅在详细模式下)
您可以要求它不更改磁盘上的任何文件,只查找挂起的 通过运行 ghcloneall --干运行进行更改。这也将使 快点检查!
概要
其他命令行选项:
$ ghcloneall --help usage: ghcloneall [-h] [--version] [-c CONCURRENCY] [-n] [-q] [-v] [--start-from REPO] [--organization ORGANIZATION] [--user USER] [--pattern PATTERN] [--include-forks] [--exclude-forks] [--include-archived] [--exclude-archived] [--include-private] [--exclude-private] [--include-disabled] [--exclude-disabled] [--init] [--http-cache DBNAME] [--no-http-cache] Clone/update all user/org repositories from GitHub. optional arguments: -h, --help show this help message and exit --version show program's version number and exit -c CONCURRENCY, --concurrency CONCURRENCY set concurrency level (default: 4) -n, --dry-run don't pull/clone, just print what would be done -q, --quiet terser output -v, --verbose perform additional checks --start-from REPO skip all repositories that come before REPO alphabetically --organization ORGANIZATION specify the GitHub organization --user USER specify the GitHub user --pattern PATTERN specify repository name glob pattern to filter --include-forks include repositories forked from other users/orgs --exclude-forks exclude repositories forked from other users/orgs (default) --include-archived include archived repositories --exclude-archived exclude archived repositories (default) --include-private include private repositories (default) --exclude-private exclude private repositories --include-disabled include disabled repositories (default) --exclude-disabled exclude disabled repositories --init create a .ghcloneallrc from command-line arguments --http-cache DBNAME cache HTTP requests on disk in an sqlite database for 5 minutes (default: .httpcache) --no-http-cache disable HTTP disk caching
配置文件
脚本在当前工作目录中查找 .ghcloneallrc ,其中 应该是这样的:
[ghcloneall] # Provide either github_user or github_org, but not both # github_org = ZopeFoundation github_user = mgedmin pattern = *.vim # You can also uncomment and change these if you wish # include_forks = False # include_archived = False # include_private = True # include_disabled = True
您可以使用 ghcloneall --init --{user,org} x [--pattern y] [--{include,exclude}-{forks,archived,private,disabled}] >
提示
为了获得最佳结果,请在 ~/.ssh/config :
Host github.com ControlMaster auto ControlPersist yes ControlPath ~/.ssh/control-%r@%h-%p
在所有382 ZopeFoundation上运行git pull需要大约80秒 使用这种设置在我的笔记本上进行回购。