Last active
November 12, 2025 11:36
-
-
Save akrez/f9b42300fc04f7a4cb659b6e08ec27ac to your computer and use it in GitHub Desktop.
commit changes to new file
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 | |
| COMMIT_HASH=$1 | |
| # Get changed files and copy them | |
| git show --name-only --pretty=format: $COMMIT_HASH | while read file; do | |
| if [ -n "$file" ] && [ -f "$file" ]; then | |
| echo "================== FILE: $file ==================" | |
| cat "$file" | |
| fi | |
| done |
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
| { | |
| git diff --name-only --cached | |
| git diff --name-only | |
| } | sort | uniq | while read file; do if [ -n "$file" ] && [ -f "$file" ]; then | |
| echo "================== FILE: $file ==================" | |
| cat "$file" | |
| echo -e "nn" | |
| fi; done > ch.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment