Created
August 4, 2022 07:46
-
-
Save alexradzin/2b7dba05aa5e418796b9ec2f307e8f5f to your computer and use it in GitHub Desktop.
Script that iterates over git revisions from oldest to the newest in current branch
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/sh | |
pressAnyKey="Press any key to continue" | |
pressAnyKeySpaces=`echo $pressAnyKey | sed 's/./ /g'` | |
(git log --pretty="format:%H %s"; echo) | tac | while read line; do | |
hash=`echo $line | cut -d' ' -f1`; | |
message=`echo $line | cut -d' ' -f2-`; | |
git checkout -q $hash; | |
echo $message; | |
printf "$pressAnyKey\r" | |
read -s -n 1 <&1; | |
printf "$pressAnyKeySpaces\r" | |
git switch - -q; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment