Big Data/Analytics Zone is brought to you in partnership with:
DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Git-Archive Your Current Tree

  • submit to reddit
        I love quick and dirty alias commands. Especially to help me out in my development process.

Here's one that grabs the last "tree-ish" (tree ID) from git-reflog then uses it with git-archive. Archives your current tree into a nice and tidy zip file.

alias gita="git-archive --format=zip `git-reflog | grep 'HEAD@{0}' | cut -d \" \" -f1 | sed 's/[.]*//g'` >"

For more information.
git-archive --help