Last active
November 17, 2017 22:45
-
-
Save carbontwelve/e7574bed23ce1d9f351365fe16076dd3 to your computer and use it in GitHub Desktop.
Identify files modified between two versions
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
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I turned this into a command line tool here https://github.com/photogabble/go-git-archive