https://github.com/mfdeux/git-extract
Extract files or directories from a git repository
https://github.com/mfdeux/git-extract
git python version-control
Last synced: 3 months ago
JSON representation
Extract files or directories from a git repository
- Host: GitHub
- URL: https://github.com/mfdeux/git-extract
- Owner: mfdeux
- License: mit
- Created: 2020-08-04T16:48:38.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-05T21:02:57.000Z (almost 6 years ago)
- Last Synced: 2025-12-16T15:45:53.748Z (6 months ago)
- Topics: git, python, version-control
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://lbesson.mit-license.org/)
[](https://pypi.org/project/git-extract/)
# git-extract
Extract files or directories from a git repository
## Installation
```shell script
$ pip install git-extract --upgrade
```
[Official PyPi Repository]((https://pypi.org/project/git-extract/))
## Usage
Extract files with multiple patterns:
```shell script
$ git-extract file https://github.com/mfdeux/git-extract --pattern "*.md" --pattern "*.py" --dest ~/Downloads/test --recursive
```
Extract directory with pattern:
```shell script
$ git-extract dir https://github.com/mfdeux/git-extract --pattern "tests" --dest ~/Downloads/test
```
## Patterns
Multiple patterns are acceptable -- as many as you want!
You can think of patterns as filters. When git-extract is looking throughout the git repository, it will match files or directories based on the patterns supplied.
All patterns are based on standard Python glob patterns.
You can read more about how to construct the patterns at:
[https://docs.python.org/3/library/glob.html](https://docs.python.org/3/library/glob.html)