Skip to content

Instantly share code, notes, and snippets.

@joshfreemanIO
Last active August 29, 2015 14:02
Show Gist options
  • Save joshfreemanIO/2575a8028c4b494e2dd9 to your computer and use it in GitHub Desktop.
Save joshfreemanIO/2575a8028c4b494e2dd9 to your computer and use it in GitHub Desktop.
List the short hash and your message summary for the previous 12 hours
# Place this into your .bash_aliases and ensure you source the file
# To use, run `gitlog` to get the commits for the past 12 hours
# To get a different time range, run `gitlog 36` for the previous 36 hours
function gitlog() {
if [ -z "$1" ]
then
HOURS=12
else
HOURS=$1
fi
# stdout for clear is ^[[H^[[2J
# Capture method output and ignore
NULL=`clear`;
git log --reverse --author="`git config user.name`" --format="%h (%s)" --since="`date -v-${HOURS}H`"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment