Skip to content

Instantly share code, notes, and snippets.

@carbontwelve
Last active November 17, 2017 22:45
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 carbontwelve/e7574bed23ce1d9f351365fe16076dd3 to your computer and use it in GitHub Desktop.
Save carbontwelve/e7574bed23ce1d9f351365fe16076dd3 to your computer and use it in GitHub Desktop.
Identify files modified between two versions
# Ask the user for the two hashes from -> to
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $FROM $TO
# If $TO is longform use the below to check the user is currently there
git rev-parse HEAD
# Else use the below for shortform hash
git log --pretty=format:'%h' -n 1
# If the current HEAD is not $TO then exit and tell the user to checkout the right version.
# With the list from the diff-tree copy files into a temp folder then once done zip that folder and present it to the user
@carbontwelve
Copy link
Author

I turned this into a command line tool here https://github.com/photogabble/go-git-archive

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