While working on a project, I often have to run these commands sequentially
git add --all; git commit -m "some commit message"; git push to push the recent work to the remote repository.
I thought it would be better to write a function, that encapsulates these three commands and put that in my
.zshrc file, so it is available everytime I start the shell. So I wrote the following function,
git add --all
git commit -m "$*"
export -f gp
When I source the
.zshrc file or start a new shell session. It throws the following error:
parse error near `()'
I have checked online for the correct syntax for defining function and the above function looks correct to me. I am at loss here on how to resolve this error, will greatly appreciate your help.