short example
Bash
#!/bin/sh
#clone + submodules
git clone --recursive -j8 https://github.com/tvheadend/tvheadend.git
#create git rev
cd foldername/
GIT_REV=`git log --pretty=oneline -n1`
cd ..
#create zip
mv foldername/ foldername-$GIT_REV/
tar cvJf foldername-$GIT_REV.tar.xz foldername-$GIT_REV
Display More
https://github.com/tvheadend/tvheadend.git is ofc just an example