Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruslo/817fb379cf150f9c7dbc6514b8ca00c8 to your computer and use it in GitHub Desktop.
Save ruslo/817fb379cf150f9c7dbc6514b8ca00c8 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
set -x
BRANCHNAME="`git rev-parse --abbrev-ref HEAD`"
echo "Packing branch: '${BRANCHNAME}'"
rm -rf _packing ${BRANCHNAME}.tar ${BRANCHNAME}.7z
mkdir _packing
git archive ${BRANCHNAME} > ${BRANCHNAME}.tar
tar -x -f ${BRANCHNAME}.tar -C _packing
(cd _packing && 7z a -t7z -m0=lzma -mx=9 -mfb=128 -md=64m -ms=on ../${BRANCHNAME}.7z .)
ls -la ${BRANCHNAME}.7z
@ruslo
Copy link
Author

ruslo commented Nov 3, 2016

Warning! Commit all the changes you need before running the script!

Rule of thumb:

> git status
# nothing

> git branch -vv
# check that you're on the right branch

> /path/to/create-7z.sh # run this script

@ruslo
Copy link
Author

ruslo commented Nov 12, 2016

This script can be used as a workaround for https://github.com/ruslo/hunter/issues/230

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