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

08.29.2008
| 7793 views |
  • 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'` > archive.zip"

For more information.
git-archive --help