I have this function to make make it simpeler for me to push to git. It works fine with pushing without arguments, however when I pass a parameter to the function I get -bash: parameter: command not found. For as far as I know, I am calling the function correctly.
function gitPush {
if ($1)
then
if ($2)
then
git push $2 $1
else
git push origin $1
fi
else
git push origin master
fi
}
When I call it using gitPush it works fine, however gitPush branch does not work.
I would like to know what I am doing wrong and how to fix it.
I don't know if it affects the execution of the function (expect not), but I am using Putty