Somewhere on the Internet. It was purportedly written by @spearce (aka Shawn O. Pearce), but I looked in his repos for several seconds and didn't see it.
At least, it is according to the comment docs.
git checkout r<tab>
autocompletes to my remote of "rapid7"
if [ -f /path/to/git-completion.bash ]; then
. /path/to/git-completion.bash
fi