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.taror.zipfile) 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 archiveis piped (|) directly into thetarcommand.
tar -xextracts the files from the archive stream it receives fromgit archive.
As soon asgit archivecreates the archive,tarextracts 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?