克隆/更新所有用户/组织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

下面是上面的一个截图(运行一个稍旧的版本,以便 脚本名称不同:

ascicast

详细信息

它的功能:

  • 克隆本地没有的存储库
  • 提取本地已有存储库的更改
  • 警告您有关本地更改和其他意外情况:
    • 树中的未知文件(仅在详细模式下)
    • 分阶段但未提交的更改
    • 未承诺(和未时效的更改)
    • 非主分行已签出
    • 提交的更改尚未推送到主服务器
    • 指向意外位置的远程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秒 使用这种设置在我的笔记本上进行回购。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
编译器构造为什么在Java中允许初始化对Null的引用?   java手动调用javax的actionPerformed。摆动计时器   使用git分支的java Maven版本控制   Java8句子流   java JPA OneToOne和OneToMany实体实例化/创建   java如何将值添加到列表<Map<String,Object>>?   java如何使用ComboBox在一个框架内更改JPanel。getSelectedIndex()   java在比较XML和xmlunit时忽略文本差异   java无法从其他pc连接到本地主机   Java中分配对象id的优雅方式   Java中静态变量的使用   java试图从Neteller获取OAuth访问令牌时产生错误:“服务器返回HTTP响应代码:401表示URL”   Java:基元类型是否会影响性能?   java可以让hasNext()不区分大小写吗?   基于AutoCompleteTextView建议属性或AutoCompleteTextView值的java Android搜索   java流文件到firefox浏览器有时无法打开应用程序对话框   在没有ArrayList的Java中返回数组中的搜索结果   复制java。木卫一。IOException:数据错误(CRC)   java为什么我在尝试删除Facebook测试用户时会出现“方法未实现”错误   java如何使用JNA调用SetProcessReliationPolicy