Skip to content

Instantly share code, notes, and snippets.

@andjc
Forked from dougalcampbell/gitzip.sh
Created March 23, 2023 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andjc/a833fe1dc9799fad7bc416f059b9d8f1 to your computer and use it in GitHub Desktop.
Save andjc/a833fe1dc9799fad7bc416f059b9d8f1 to your computer and use it in GitHub Desktop.
gitzip -- create a zip file of a git project
#!/bin/bash
##
## I usually put this in my .bashrc
##
## When in a git project dir, run 'gitzip foo' to get a 'foo.zip' in the parent
## directory.
gitzip() { git archive HEAD --format=zip --prefix="$*/" > ../"$*.zip"; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment