将文件从git存储库导入到本地目标。
import-git-files的Python项目详细描述
导入git文件
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
了解更多信息。在
- 项目
标签: