Extracting a blob (file) from an arbitrary revision is easy with git show
, e.g.:
git show master:src/hello-world.c > /tmp/hello.c
However, I'd like to know if is there a similar way in git to extract a tree (directory) and everything under it recursively?
I've written a small script that does this, so I'll add that as a possible answer. It seems that this is the kind of thing that may well be built in to git, but I just don't know how to find it...