I want to make an alias for a somehow complex git command:
git push origin HEAD:refs/for/BRANCH-NAME
I want the command my-alias my-branch
to run git push origin HEAD:refs/for/my-branch
. So far I've tried:
alias my-push='git push origin HEAD:refs/for/$1'
alias my-push='git push origin HEAD:refs/for/"$1"'
I would like to know the right solution and the explanation why does above fail.
I do have such alias:
alias run-schema='cd ~/sources/schema; python -m SimpleHTTPServer $1'
and it works fine - there are no extra apostrophe/quote signs.