Thingy Ma Jig is the blog of Nicholas Thompson and contains any useful tips, sites and general blog-stuff which are considered interesting or handy!
Posted on 15 December 2011 in
Drupal
git
webdev
Have you ever needed or wanted to pull a remote Git Repository on Drupal.org down as a zip or tarball? You know, the way Github does? Most project releases have fairly recently built tarballs which is awesome - but Sandboxes do not (so it seems - please correct me if I'm wrong!).
The following snippet lets you "archive" a remote repository, pull it down as a tarball, and extract it in-place:
git archive --format=tar --prefix=PROJECT/ --remote=USERNAME@git.drupal.org:sandbox/USERNAME/123456789.git BRANCH | tar -xf -
Some important notes:
I have tried using the "zip" format, however the unzip
bash command doesn't accept stdin
as a source. It looks like funzip
might hold some promise thought…
EDIT: - looks like you can only do this if your user has access to the repository.