Skip to content

Instantly share code, notes, and snippets.

@farskid
Forked from LeonardoCardoso/gitzip.sh
Created June 1, 2021 13:54
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 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 $@.zip 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