Skip to main content

git-remote-get

PyPI version Testsuite Python version Project Status Supported Interpreters License

Download single files or directories from a git remote repository without cloning its entire contents.

Installation

pip install git-remote-get

Usage

Usage: git-remote-get [OPTIONS] PATH [DESTINATION]

  Get a file from a remote git repository

  Arguments:     
    PATH: The path on the remote repository to get the file from
    DESTINATION: The path to save the file to. Defaults to the same as the path.

Options:
  --repo TEXT          The repo to get the file from. You can also set the
                       GGET_REPO environment variable to set this option.
  --from TEXT          Alias for --repo
  --owner TEXT         The owner of the repo to get the file from. You can
                       also set the GGET_OWNER environment variable to set
                       this option.  [required]
  --provider [github]  The remote repository provider to get the file from.
                       Defaults to github. Currently, only github is
                       supported. You can set the GGET_PROVIDER environment
                       variable to set this option.
  --ref TEXT           Branch or commit to get the file from. Defaults to
                       master. You can set the GGET_REF environment variable
                       to set this option.
  --help               Show this message and exit.

You can also use the gget alias for git-remote-get.

.env template

You can create a .env file in the root of your project to set default options for the program.

# .env
GGET_OWNER='<your-git-remote-repository-owner-name>'
GGET_REPO='<your-git-remote-repository-name>'
GGET_PROVIDER='github'
GGET_REF='<your-git-remote-repository-branch-or-commit>'

Examples

# This will download the README file from the octocat/Hello-World repository
# and save it to the current directory with same name
gget README --owner=octocat --repo=Hello-World

# This will download the README file
# and save it to docs/README.md
gget README --owner=octocat --repo=Hello-World docs/README.md

# This will download `examples/tutorial`
# of flask repository and save it to the current directory.
#
# If destination is not provided, the program
# will create a directory with the same name as the PATH.
#
# In other words, you will get `examples/tutorial` directory
# and its contents inside that directory.
gget examples/tutorial --owner=pallets --repo=flask --ref=main

# This will download the `examples/tutorial`
# of flask repository and save it to `tutorial` directory.
#
# In this case, the destination is provided.
# Contents under `examples/tutorial` will be saved to `tutorial-contents` directory.
gget examples/tutorial --owner=pallets --repo=flask --ref=main tutorial-contents

Contributing

Any contribution is welcome! Check out CONTRIBUTING.md and CODE_OF_CONDUCT.md for more information on how to get started.

License

git-remote-get is licensed under a MIT License.

Metadata

Release files for git-remote-get 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-remote-get 0.3.1
File Size Uploaded
git_remote_get-0.3.1.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git-remote-get 0.3.1
File Interpreter ABI Platform
git_remote_get-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.7 kB

Release files / git_remote_get-0.3.1.tar.gz

Download URL git_remote_get-0.3.1.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cfef6a21f2ef25e8475e05f48618da0d973914ce558422b841ba81bd6ac852a5
BLAKE2b-256 checksum
How to use checksums
84f3fb9005278481aca17cd05ac462f257805bdde28879c0d85dfc6a00757700
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Linux/6.5.0-1018-azure

Release files / git_remote_get-0.3.1-py3-none-any.whl

Download URL git_remote_get-0.3.1-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69a7d7c25d554bc8c14c004c645d4df520ce545b4a300d56eb49d906ab7d6600
BLAKE2b-256 checksum
How to use checksums
2f317cf66e9c9061a9d194d152738e4450c328ee2c6649447a3066654657e9e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Linux/6.5.0-1018-azure

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page