Skip to content

Instantly share code, notes, and snippets.

@alecthegeek
Last active Aug 23, 2020
Embed
What would you like to do?
Git alias for next `git next` to go to next commit. Works on Powershell
# Git alias for next `git next` to go to next commit. Works on Powershell, brobably works on Bash as well.
# Useful for live code demo. See https://blog.jayway.com/2015/03/30/using-git-commits-to-drive-a-live-coding-session
# Info about mapfile from https://www.computerhope.com/unix/bash/mapfile.htm
# Needed because Git on Windows does not have access to tail (by default)
next = "!$SHELL -c 'git checkout $(mapfile -t < <(git rev-list HEAD..demo-end);echo -n ${MAPFILE[-1]})'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment