diff options
-rw-r--r-- | git.md | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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> |