Git archive
Download a single file using git archive
Using git archive to download a single file involves accessing a remote repository and piping the output to tar to extract a specific file.
breakdown¶
-
git archive
: create an archive (like a.tar
or.zip
file) of files from a named tree in the repository. -
--remote=<repository-url>
: create the archive from a remote repository at the URL -
HEAD:path/to/directory/filename
: specifies what to include in the archive.HEAD
: the latest commit on the current branch.path/to/directory/filename
: file path within that commit.
-
| tar -x
: The output ofgit archive
is piped (|
) directly into thetar
command.
tar -x
extracts the files from the archive stream it receives fromgit archive
.
As soon asgit archive
creates the archive,tar
extracts it without having to save and extract the archive.
Backlinks¶
- git sparse-checkout
- similar to git archive
- compression on mesh variations
- Artist won’t be able to have both variants open on their pc at same time. Unless the asset manager somehow pulls only the file (git sparse-checkout or git archive) the artist wants, to a new temp repo?