Skip to content

Instantly share code, notes, and snippets.

@mishadoff
Created July 15, 2015 09:31
Show Gist options
  • Save mishadoff/3d4ee16b1501b125ece9 to your computer and use it in GitHub Desktop.
Save mishadoff/3d4ee16b1501b125ece9 to your computer and use it in GitHub Desktop.
Find the time difference between two commits
#!/bin/bash
#
# Find the time difference between two commits
# Usage: ./git_time_diff.sh 863a810d 7407b97c
commit1=$1
commit2=$2
ts1=$(git show -s --format=%ct $commit1)
ts2=$(git show -s --format=%ct $commit2)
tdiff=$((ts2 - ts1))
echo $tdiff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment