Skip to content

Instantly share code, notes, and snippets.

@Yuji-Kuroko
Created June 6, 2016 15:34
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 Yuji-Kuroko/57ca5e5df2e6e3f026cf716cdc709a57 to your computer and use it in GitHub Desktop.
Save Yuji-Kuroko/57ca5e5df2e6e3f026cf716cdc709a57 to your computer and use it in GitHub Desktop.
#!/bin/sh
# custom action for SourceTree
# params $SHA
ARCHIVE_TO="$HOME/Desktop/archive_$(date +'%Y%m%d%H%M%S')/"
for commit_hash in $@; do
git diff --name-only ${commit_hash}~...${commit_hash} | git checkout-index --prefix=${ARCHIVE_TO} --stdin
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment