Last active
August 29, 2015 14:09
-
-
Save ericksli/474ca1ecd4154a5304e7 to your computer and use it in GitHub Desktop.
List all files with version hash in a Git repository
This file contains hidden or 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
#!/bin/bash | |
# Usage: Git checkout to the commit you want, then run this script to print the files in the repository and its version hash. | |
files="`git ls-files`" | |
while read -r filename; do | |
hash="`git log -1 --pretty=%h ${filename}`" | |
echo -e "$filename\t$hash" | |
done <<< "$files" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment