A bash alias to export a git repository to a zip file

I’ll keep this short and sweet. This bash alias will allow you to export your git repo’s master branch to a zip file.

To use it:

  1. Make sure that your work is committed.
  2. Make sure you are in the root directory of your project.

To make this script work run the following commands:

echo alias gitpack=\'git archive --format zip --output download_$(date +%d-%m-%Y-%H.%M).zip master\' >> ~/.bashrc
source ~/.bashrc

Now just type gitpack and you will get a zip file.

Be Sociable, Share!

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>