From 23deb76dc2da8fdbe3f4e75e13ba2967f84919a4 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Sat, 6 Mar 2021 12:34:58 +0100 Subject: Add git archiving --- git.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'git.md') diff --git a/git.md b/git.md index c8ae6ae..0c512d0 100644 --- a/git.md +++ b/git.md @@ -21,3 +21,12 @@ git diff > change.patch patch -p1 < change.patch # -p1 to remove the a/ and b/ from filepaths + +## Exporting a commit + + git archive + +Outputs to stdout a tar archive of the index at the given commit. Make a +directory of just the code, not a repo: + + git archive | tar --extract --directory -- cgit v1.2.3