Skip to content

Instantly share code, notes, and snippets.

@baurine
Last active September 18, 2016 03:04
Show Gist options
  • Save baurine/187e6ad50a15142ab03741912c67f289 to your computer and use it in GitHub Desktop.
Save baurine/187e6ad50a15142ab03741912c67f289 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
# 将 branch 以 zip 格式打包到指定文件
branch=$1
if [ -z "$branch" ]; then
branch=$(git branch | grep '*' | awk '{print $2}')
fi
echo $branch
file_name="../${project_name}_$(date "+%m%d%H%M")_$branch.zip"
git archive --format zip --output $file_name $branch
echo "done archive git repo to $file_name in $branch branch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment