Skip to main content

GIT TIPS: alias for creating snapshots

Posted in

Make it easier to release snapshots by adding the following lines to $HOME/.gitconfig :

    snapshot = !sh -c 'export COMMIT=`git rev-list --tags --max-count=1` \
    TAG_NAME=`git describe --tags $COMMIT` \
    && export DIR_NAME=`basename $PWD`-$TAG_NAME \
    && git archive --prefix=$DIR_NAME/ master | bzip2 > $DIR_NAME-src.tar.bz2'

Short description:

It finds the latest tag name and creates a tarball call <projname>-<tag name>.tar.bz2

Post new comment

The content of this field is kept private and will not be shown publicly.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
 o      O        o                         .oOOOo.  
O o O .O o
o O o o
OoOooOOo o o
o O ooOO O o 'OoOo. `oOOoOO. o
O o o OoO o O O o o O
o o O o O O o o O O `o .o
o O OooO O o o O O o o `OoooO'

Enter the code depicted in ASCII art style.