Skip to content

Get single files from any public repository onto your computer.

License

Notifications You must be signed in to change notification settings

gadhagod/GitHub-Grasp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Grasp

Grasp single files from any public repository onto your computer.

Installation

pip3 install github-grasp

Usage

Scrape a file:

ghg scrape [OPTIONS]

Options:
-r, --repo TEXT    Target repository  [required]
-b, --branch TEXT  Target branch (default: master)
-f, --file TEXT    Path of target file  [required]
-o, --output TEXT  Output to local file'

Example

Let's say you wanted the file scripts/authors from Facebook's React Repository.
You could use git clone, but the repository is massive, and you just need a single file.
To echo the contents file:

ghg scrape -r facebook/react -f scripts/authors

If you wanted to save the file locally, run the same command, but with the --output option.

ghg scrape -r facebook/react -f scripts/authors -o authors.sh

Now you have authors.sh on your computer!
If you wanted a file from a specific branch, you add the option --branch.
So for example, if you wanted the file .github/stale.yml from the branch 17.0.1 of the React repository, you would run...

ghg scrape -r facebook/react -f .github/stale -b 17.0.1 -o test.yml

NOTE: This branch has probably been deleted.

About

Get single files from any public repository onto your computer.

Resources

License

Stars

Watchers

Forks

Languages