Skip to main content

Import files from git repositories to local destinations.

Project description

import-git-files

import-git-files Documentation Status

Read The Docs

import-git-files enables defining file imports from 1 or more git repositories (public or private) to local destinations.

This supports use of polyrepos that may be related. Each repository may follow release definitions that the repository should only contain what is released together, yet it may be a sub-project or related project to other repositories. This import tool allows defining imports into other projects which can include commit shas, tags, and releases.

Installation

Requires Python 3.6+ and either OS X or Linux. It is not tested or supported on Windows. This is only developed and tested against GitHub repositories, but may work elsewhere.

pip install import-git-files

Usage

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.

note: When needing to setup non-interactive authentication methods, SSH deploy key is preferred over Personal Access Token. If using a PAT, avoid setting verbose logging as it may expose the token.

You can also use import_git_files module in your project and the included context manager, GitExtractedFiles. See the docs for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

import-git-files-0.1.0.tar.gz (16.9 kB view hashes)

Uploaded Source

Built Distribution

import_git_files-0.1.0-py3-none-any.whl (11.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page