Following code might help if you want to include .git/ too and don't want to include other extra files which haven't been tracked by git. Suppose the path of your git project is /opt/helloworld/, commit whatever are left, then you can do as the following:
git clone /opt/helloworld/ folder2
cd folder2
tar -czf helloworld-latest.zip folder2