run an arbitrary command against all git commits, or *n* evenly-spaced commits
Switch branches/tags
Nothing to show
Clone or download
Latest commit ad7bfbb Mar 24, 2016
Failed to load latest commit information. simplify examples Mar 24, 2016
git-map inline help function Mar 24, 2016


run an arbitrary command against all commits, or n evenly-spaced commits across time.


count number of files for every commit:

git-map "git ls-files | wc -l"

count lines of code for 10 evenly-spaced commits:

git-map "grep '' -IR . --exclude-dir={.git,log} | wc -l " -n 10

boot up webserver and take a screenshot for 5 evenly-spaced commits:

git-map ~/ -n 5

# Reinstall dependencies as they may be different for older commits
bundle install

# Boot up the server and record the process ID (so we can kill it later)
nohup bundle exec middleman >/dev/null 2>&1&

# Wait for the server to finish booting, then take a screenshot
sleep 5
open "http://localhost:4567"
sleep 5
timestamp=$(date +%s)
screencapture ~/Desktop/screenshot-$timestamp.jpg

kill $pid