Last active
August 23, 2020 07:19
-
-
Save alecthegeek/b314bb1568610f11fdaac793d8761243 to your computer and use it in GitHub Desktop.
Git alias for next `git next` to go to next commit. Works on Powershell
This file contains 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
# 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