Skip to content

Instantly share code, notes, and snippets.

@theSoberSobber
Last active December 3, 2022 13:17
Show Gist options
  • Save theSoberSobber/8293f8aa72384aefc9c9cfa9ebdf7035 to your computer and use it in GitHub Desktop.
Save theSoberSobber/8293f8aa72384aefc9c9cfa9ebdf7035 to your computer and use it in GitHub Desktop.
to step through a gh repo and study it's evolution
# include in sys varaibles to use everywhere
#!/bin/bash
echo "Enter branch name : "
read bname
chlist=$(git rev-list $bname --reverse)
tcnt=$(git rev-list $bname --count)
declare -i cnt=0
for ch in $chlist
do
# temp=$(git stash) # remove the comment hash only when you want to stash any changes you make along the way
((cnt++))
echo "Commit number : $cnt/$tcnt"
out=$(git checkout $ch)
echo $out
read
done
echo "Reached Latest Commit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment