Git alias with arguments having spaces
1 answer
Did you notice odd syntax highlighting in your question?
cax = "! f () {msg = $ {1-Default message}; git add --all && git commit -am" $ msg ";}; f" ^^^^^^^ ^^^^ black ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ red
It had to be a big hint. The problem is that it is $msg
not specified in your function definition. The symbols are "
handled specifically by Git when it reads your config file, but you want to pass those two symbols to the shell. Use instead \"$msg\"
.
+3
source to share