Monday, September 28, 2009

Git Archive

I've been working with some code on rightscale. A common workflow for me is:

1. Hack, hack, hack.
2. Commit.
3. Export to a compressed tarball.
4. Upload to rightscale as a script attachment.

Today I figured out a better way to do #3. Here is a simple script I wrote to automate the export (names changed).

#!/bin/bash

echo "Reminder: This exports from master."

git archive --prefix=client1/ master | gzip > client1-tools.tar.gz

This saves me a step over copying my working copy and removing .git.

No comments: