-
-
Save kriscarle/8700599 to your computer and use it in GitHub Desktop.
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
./git-copy.sh aabb37fc243675de1194e38f75a554695ed3c111 7b6efc6a0731d0da7ce0d13b19098db2f7da224b ../uploads |
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
#!/bin/bash | |
# Target directory | |
TARGET=$3 | |
echo "Coping to $TARGET" | |
echo -e "Changes between $1 and $2 \n\r" > "$TARGET/README.txt" | |
for i in $(git diff --name-only $1 $2) | |
do | |
# First create the target directory, if it doesn't exist. | |
mkdir -p "$TARGET/$(dirname $i)" | |
# Then copy over the file. | |
cp "$i" "$TARGET/$i" | |
echo -e "$i \n\r" >> "$TARGET/README.txt" | |
done | |
echo "Done"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
updated to also write a list to README.txt