Create a tarball from a specific git commit

I have this code I’m working on that is needs to be deployed remotely (Fabric makes this SO easy) and I’m using git as my version control system. Well, I was creating tarballs for this, but I was basically doing them as similar as I could to what git had in the tree (ignoring the same files, etc.), so it was kind of repetitive and, boring. Well, git to the rescue!!!


git archive --format=tar HEAD | gzip > myproject.tar.gz

And you have a nice clean zipped tarball of your code as is on HEAD, without tears :)

Git is awesome!

Comments are currently closed.