I'm not entirely sure, but `:` means "true" in bash, and if I omit it, something like this happens:
$ git config alias.foo '! echo "$1";'
$ git foo bar
bar
echo "$1";: bar: command not found
Whereas if I end with `; :` then it works as expected:
$ git config alias.foo '! echo "$1"; :'
$ git foo bar
bar
It seems to execute the last argument (`bar`) as a command without the `:` at the end, and I don't have a `bar` command on my PATH so it angrily fails with exit code 127. If it instead executes `:` however, that will make it happily exit with 0.
It seems to be a Git alias quirk, but I may be incorrect here.
Huh I had no idea $1/$2/etc worked as-is in an alias. The advice I learned years ago for dealing with any alias that needs to do something custom with parameters is to write it like
git config alias.foo '!f() { actual command goes here }; f'
as that will pass all the args to the shell function. But if git is already setting it up so the args work then suffixing the alias with ";:" seems simpler.
It seems to be a Git alias quirk, but I may be incorrect here.