Skip to content

Instantly share code, notes, and snippets.

@hangox
Last active May 25, 2018 02:59
Show Gist options
  • Save hangox/bac89d813dfb99753383e294f0af606d to your computer and use it in GitHub Desktop.
Save hangox/bac89d813dfb99753383e294f0af606d to your computer and use it in GitHub Desktop.
Git打包命令
简单的用法就是
git archive --format zip --output /path/to/file.zip master # 将 master 以zip格式打包到指定文件
还有个更简单的
git archive v0.1 | gzip > site.tgz
git archive master > /home/hainuo/fds.zip
还有一个增量的
git archive develop $( git diff v1.1.8_beta13..v1.1.8_beta14 --name-only)|gzip >aaa.zip #比较两个版本之间的差异文件,生成一个差异文件压缩包
@zhanglianxin
Copy link

git archive master > /home/hainuo/fds.zip

打包之后无法使用压缩工具(7-zip)正常解压。

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