Created
November 3, 2025 12:03
-
-
Save sirtawast/ab18f50b39d33b772336437dad940b14 to your computer and use it in GitHub Desktop.
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
| for file in $(git diff --name-only --cached); do | |
| previous_commit=$(git rev-list -1 HEAD -- $file) | |
| previous_commit_msg=$(git rev-list --format="%s" -1 HEAD -- $file | tail -n 1) | |
| if [ -z "$previous_commit" ]; then | |
| echo "$file NEW" | |
| else | |
| echo "$file $previous_commit" | |
| git commit -m "fixup! $previous_commit_msg" -m "$file $previous_commit" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment