When I try to create an alias
[alias]
my-alias = submodule foreach 'git foo ; git bar'
Git (version 1.7.1) spews the error
user@host:/path/repo.git$ git my-alias
error: unclosed quote
fatal: Bad alias.my-alias string
It appears that .gitconfig uses weird parsing rules, so that ; is treated as starting a line comment, even inside of a quote.
How do I specify this alias?
Wrap the entire alias command in double quotes:
The double quotes cause the
.gitconfigparser to pass the semicolon. The single quotes are still needed to delimit the argument tosubmodule foreach; without them, it gets parsed asso that
git baronly gets executed once, at the end.