Monday, November 21, 2011

How to export projects out of git archive

You can do this using git archive command

Following code will extract the current checked out branch, create tar and zip it
git archive --format=tar --prefix=<any dir name you want>/   HEAD | gzip >latest.tar.gz

Following code will extract master branch, create tar and zip it
git archive --format=tar --prefix=<any dir name you want>/   master | gzip >latest.tar.gz

No comments:

Post a Comment