Skip to content

Instantly share code, notes, and snippets.

@kidsil
Created May 21, 2024 12:15
Show Gist options
  • Save kidsil/b5dbf9dbee486e8bf000641a9313cc19 to your computer and use it in GitHub Desktop.
Save kidsil/b5dbf9dbee486e8bf000641a9313cc19 to your computer and use it in GitHub Desktop.
git first and last commits using git log - zsh functions/aliases
# 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