And git alias is called with arguments added to the alias as is command line. The fact that named arguments ( $1 , $2 , etc.) are extended on the command line does not prevent the addition of these arguments to the alias extended command.
In your example
git pomt myTagGoesHere
expands to
git push origin master && git tag myTagGoesHere && git push --tag myTagGoesHere
Thus, myTagGoesHere is passed to the git push command, which leads to an observed error.
VonC has already shown how to get around this problem by introducing a (temporary) function . Another solution is to pass arguments to the no-op command:
pomt = !git push origin master && git tag '$1' && git push --tag && :
EDIT
By the way, you can debug the git shell operation with the set -x prefix:
$ git config alias.pomt '!set -x; git push origin master && git tag $1 && git push --tags' $ git pomt tag5 + git push origin master Everything up-to-date + git tag tag5 + git push --tags tag5 fatal: 'tag5' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
source share