Skip to content

Instantly share code, notes, and snippets.

@farskid
Forked from LeonardoCardoso/gitzip.sh
Created June 1, 2021 13:54
Show Gist options
  • Save farskid/5522b18d2dd6627ac8668b8555b15b75 to your computer and use it in GitHub Desktop.
Save farskid/5522b18d2dd6627ac8668b8555b15b75 to your computer and use it in GitHub Desktop.
Zip folder ignoring files listed on .gitignore
#...
function gitzip() {
git archive -o [email protected] HEAD
}
#... gitzip ZIPPED_FILE_NAME
@farskid
Copy link
Author

farskid commented Jun 1, 2021

#if you want the file to have the name of the current folder if you're lazy about typing the zipfile name
git archive HEAD -o ${PWD##*/}.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment