Skip to content

Instantly share code, notes, and snippets.

@gladx
Created July 4, 2022 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gladx/3b75165f2ae74b9becfbc0f6ffb55949 to your computer and use it in GitHub Desktop.
Save gladx/3b75165f2ae74b9becfbc0f6ffb55949 to your computer and use it in GitHub Desktop.
get git update last changes
#!/bin/bash
# gitup.sh
# gitup.sh HEAD
# gitup.sh HEAD~3
if [ ! -z "$1" ] ; then
echo "Createing ../update.zip "
git diff --name-only "$1" --diff-filter=d
git archive -o ../update.zip HEAD $(git diff --name-only "$1" --diff-filter=d)
else
echo "Createing ../update.zip "
git diff --name-only HEAD^ --diff-filter=d
git archive -o ../update.zip HEAD $(git diff --name-only HEAD^ --diff-filter=d)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment