I have the following bash function :
tg() {
git add -A && git commit -m $1 && git push
}
But it seems not to work :
$ tg "create index for users"
error: pathspec 'index' did not match any file(s) known to git.
error: pathspec 'for' did not match any file(s) known to git.
error: pathspec 'users' did not match any file(s) known to git.
Obviously, the problem is that the quote was expanded and my middle command was read as git commit -m create index for users
rather than git commit -m "create index for users"
What did I do wrong ? How can I fix this ?