Skip to content

Instantly share code, notes, and snippets.

Last active October 9, 2023 22:38
  • Star 50 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Zip folder ignoring files listed on .gitignore
function gitzip() {
git archive -o $ HEAD
#... gitzip ZIPPED_FILE_NAME
Copy link

ddieppa commented Dec 9, 2020

used this one for windows Powershell:

git archive HEAD -o ../$(Split-Path -Path ${PWD} -Leaf)-$(Get-Date -UFormat "%Y.%m.%d-%H.%M").zip

Copy link

htho commented Sep 2, 2021

I got here when i looked for a command do backup the whole (local) repository including .git.

Here it is:

7z.exe a -bd ../archive.7z * '-xr@.\.gitignore'

Based on this answer:

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