When answering "Git pull hook script which executes locally", I stumbled upon the use-case to alias a built-in git command such as pull
or push
with an extension. How do I do that?
First thought was:
[alias]
push = "!echo -n \"really push? [y/n]\";read -s -n 1 really;if [[ $really == \"y\" ]];then git push; else echo \"aborting\"; fi"
This works fine as long as I don't name my alias push
(for example qp
or something like that). But as soon as I call it push
, it's somehow ignored.
Is there a git way to expand a built in git command with an alias or do I have to set up an alias in my .bashrc
?