Last active
September 18, 2016 03:04
-
-
Save baurine/187e6ad50a15142ab03741912c67f289 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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