Skip to content

Instantly share code, notes, and snippets.

@brendandawes
Last active December 6, 2017 11:41
Show Gist options
  • Save brendandawes/9cb4222218c3086d99b9096389ce5fd9 to your computer and use it in GitHub Desktop.
Save brendandawes/9cb4222218c3086d99b9096389ce5fd9 to your computer and use it in GitHub Desktop.
Export branches. Replace <outputDirectory> with the path to where you want to export the branches.
for branch in $(git for-each-ref --format='%(refname:short)' refs/heads);
do git archive --format zip --output <outputDirectory>/${branch}.zip $branch;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment