m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Chrzanowski <m@m-chrzan.xyz>2021-03-06 12:34:58 +0100
committerMarcin Chrzanowski <m@m-chrzan.xyz>2021-03-06 12:34:58 +0100
commit23deb76dc2da8fdbe3f4e75e13ba2967f84919a4 (patch)
tree9a3f54f4c3450b96668c2ec83f8905e671bdd3d6
parent773925056395b0544b08ccb708c1f2f1bc9508bb (diff)
Add git archiving
-rw-r--r--git.md9
1 files changed, 9 insertions, 0 deletions
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 <commit>
+
+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 <commit> | tar --extract --directory <output dir>