Skip to content

Instantly share code, notes, and snippets.

@oliverpool
Forked from kvz/git-timetracker.sh
Last active December 7, 2016 12:10
Show Gist options
  • Save oliverpool/c6c0b9064a8f39bbf5ee9828d2696e77 to your computer and use it in GitHub Desktop.
Save oliverpool/c6c0b9064a8f39bbf5ee9828d2696e77 to your computer and use it in GitHub Desktop.
You can then type git timetrack, git timetrack "1 day", git timetrack "1 month" --reverse (the arguments are positional, so the duration is required in this case) in any git repository!
# add it to your ~/.gitconfig as an alias:
[alias]
timetrack = "!f() { \
git --no-pager log \
--date=iso \
--since="${1-2 months}$" \
"${2}" \
--date-order \
--full-history \
--all \
--pretty=tformat:'%C(cyan)%ad%x08%x08%x08%x08%x08%x08%x08%x08%x08 %C(bold red)%h %C(bold blue)%<(22)%ae %C(reset)%s'; \
}; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment