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 :

[alias]
    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.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
mu_t_media: