I often want to just create a commit when testing or showing off some git commands, but lack the creativity or bother to write some recognizable changes or commit messages.
On Mac or Linux, I use this nifty one-liner:
echo "Here's some random content: `random_word`" >> readme.txt; git commit -am "A random commit message: `random_word`"
Now you probably don't have this random_word command on your system yet. Here's what it does (worksforme on both OSX and Ubuntu):
#! /bin/bash perl -e 'open IN, "</usr/share/dict/words";rand($.) < 1 && ($n=$_) while <IN>;print $n'
commit d53935606f130bc99dd8ace491a819f706076057 Author: Thomas Ferris Nicolaisen <...> Date: Fri Nov 23 09:18:32 2012 +0100 A random commit message: soundproofing .... diff --git a/readme.txt b/readme.txt .... +Here's some random content: freight