将文件从git存储库导入到本地目标。

import-git-files的Python项目详细描述


导入git文件

import-git-filesDocumentation Status

Read The Docs

import-git-files允许定义从1个或多个git存储库(公共或私有)到本地目标的文件导入。在

这支持使用可能相关的polyrepos。每个存储库可能遵循存储库只应包含的发布定义 什么是一起发布的,但它可能是一个子项目或与其他存储库相关的项目。此导入工具允许定义导入 包括提交sha、标记和发布的其他项目。在

安装

需要Python3.6+和OS X或Linux。 Windows不测试或不支持它。这只是开发和测试 针对GitHub存储库,但可能在其他地方工作。在

pip install import-git-files

使用

usage: import-git-files [-h] [--version] [-v] [-t TEMPORARY_DIRECTORY_PARENT]
                        [--ssh-key SSH_KEY]
                        input

Import files from other repositories. Define the imports in a JSON file and
pass as input argument. If the repositories are private and require
authentication but you do not have cached credentials and are using it in a
non-interactive way, you can either define a Personal Access Token in your
Environment under variable GITHUB_TOKEN or you can specify a path to an SSH
Deploy Key.

positional arguments:
  input                 The input json with a hash of repo URLs and their
                        value being hash of source path and destination path.
                        Source path should be relative to root of repository
                        and the destination path can be absolute or it can be
                        relative to the PWD.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -v, --verbose         Set logging to verbose
  -t TEMPORARY_DIRECTORY_PARENT, --temporary-directory-parent TEMPORARY_DIRECTORY_PARENT
                        Optionally set the parent directory for temporary
                        directories or else will use system tmp default.
  --ssh-key SSH_KEY     Path to an SSH Key with access to the repository. This
                        file needs 600 permissions. This cannot be defined in
                        combination with GITHUB_TOKEN environment variable.

注意:当需要设置非交互式身份验证方法时, SSH部署密钥优于个人访问令牌。如果使用拍子,避免 设置详细日志记录,因为它可能会暴露令牌。在

您还可以在项目中使用import_git_files模块和包含的 上下文管理器,GitExtractedFiles。见docs 了解更多信息。在

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

推荐PyPI第三方库


热门话题
java从Dropwizard中的Minio检索文件时,GET请求中的超时是如何处理的?   带Hibernate的java Jackson用于序列化以避免枚举   Raspberry Pi上的java Jave分段错误   java在屏幕旋转时不保存当前片段和数据   java War文件未在Heroku上正确部署   如何使用Java处理Selenium webdriver中的促销广告或cookie   java处理“用法:PApplet[options]<classname>[sketch args]”   java文本文件错误扫描程序   运行第一个JavaFX模块化程序时出现java异常   java将fileoutputstream转换为字符串   如何调试gstreamerjava?   java Spring RestTemplate ResponseBody类是什么样的   如何将JSON数组转换为Java列表。我在用斯文森   javascript在显示div按钮后进入新页面