Last Updated: February 25, 2016
· davidstump

Create A Simple Git Timesheet

At the end of each day, I find myself crawling through the git logs to record my activities for the day on our timesheet software. It eventually occurred to me that with a few super simple arguments passed to the git log command, I could have a basic output of my timesheet for that day.

Step 1. Edit Your bash_profile file:

$ subl ~/.bash_profile

Step 2. Add an alias to your profile:

git log --oneline --author="`git config --get`" --since='6am'

Step 3. Save your profile

Step 4. Check your daily timesheet:

david:~/Projects/octopress❮source❯$ timesheet
 2a08dac Adjust navigation mobile styles and hide search field
 816cfef Apply custom style to site
 b96240c Add Murky-Mussels Theme

Nothing complicated at all, but hopefully someone else finds this as helpful as I did. Thanks to @chris_mccord for adding the snippet to this alias.


3 Responses
Add your response

Cool, I like this. I didn't know about --since. I've also been trying to learn about my productivity through git. I wrote git-spark to plot my commit history over time on the command line. Now I want to add a --since option.

over 1 year ago ·

Just adding some optional argument:

timesheet () {
  if [ -z "$1" ]; then
  git log --oneline --author="`git config --get`" --since=$SINCE
over 1 year ago ·

@kablamo Try to use gitstats

over 1 year ago ·