Skip to content

Instantly share code, notes, and snippets.

@dilipkrish
Created November 21, 2013 22:28
Show Gist options
  • Select an option

  • Save dilipkrish/7590914 to your computer and use it in GitHub Desktop.

Select an option

Save dilipkrish/7590914 to your computer and use it in GitHub Desktop.
#!/bin/zsh
commits=(`git rev-list HEAD --count`)
branch_name=$(git symbolic-ref -q HEAD)
branch_name=${branch_name##refs/heads/}
echo $branch_name
if [ $branch_name '==' 'demo' ]; then
for (( f = $commits - 1; f >= 0; f -= 1 )); do
git checkout demo~$f
read
done
fi
@dilipkrish
Copy link
Author

Script to replay a 'demo' branch chronologically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment