Created
May 21, 2024 12:15
-
-
Save kidsil/b5dbf9dbee486e8bf000641a9313cc19 to your computer and use it in GitHub Desktop.
git first and last commits using git log - zsh functions/aliases
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
# Function to show the first X commits | |
function git-first { | |
git log --format="%H" | tac | head -n $1 | xargs git log -p | |
} | |
# Function to show the last X commits | |
function git-last { | |
git log -p -n $1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment