Github provides a feature of downloading entire repository from a single URL (a tarball). The downloaded repository file is combined into a single file using Linux
tar command. The archive file is also compressed using
The tarball URL is as follows:
username is Github username,
repository is Github repository name and
version can be either a git repository branch name or a tag name.
The repository tarball file can be downloaded using one of the popular tools like
curl. Let's try to get Flake Id generator: https://github.com/T-PWK/flake-idgen
The file will contain a repository directory with name convention as follows:
username is a Github username,
repository is a Github repository name and
abbreviated-SHA-1-checksum is the latest commit in a specified branch or the specified tag commit abbreviated SHA-1 checksum.
Example: https://github.com/T-PWK/flake-idgen/tarball/v0.1.4 will contain a repository for tag v0.1.4 and the directory will be called
To download the master version of the repository, use the following command
If you want to extract repository directory bypassing file download, you can use
-O - option (to have the file written to standard output) and pipe the output to
tar xz command.
wget -O - https://github.com/T-PWK/flake-idgen/tarball/master | tar xz
curl is very similar to wget in respect of a tarball file download. However,
-L follow HTTP(S) redirects option must be used (wget follows HTTP(S) redirects by default) as the tarball files are served by slightly different URL.
curl -L https://github.com/T-PWK/flake-idgen/tarball/master > master
Alternatively you can extract the repository directory straight from the input stream
curl -L https://github.com/T-PWK/flake-idgen/tarball/master | tar xz