这个问题可能有些愚蠢,但我真的不确定是否可行。
我经常打错 "git stash pop" (不用管为什么)。 我能否将我的错误映射/快捷方式/别名到正确的命令上?
这个问题可能有些愚蠢,但我真的不确定是否可行。
我经常打错 "git stash pop" (不用管为什么)。 我能否将我的错误映射/快捷方式/别名到正确的命令上?
git config --global alias.sp 'stash pop'
那么git sp
会被扩展为git stash pop
定义一个Shell函数:
git() {
if [ "$1" == "stash" -a "$2" == "poop" ]; then
shift; shift; command git stash pop "$@"
else
command git "$@"
fi
}
如果您需要正确生成的输出...
if [ "$1" == "stash" -a "$2" == "poop" ]
then
command git stash pop
echo "
) )
( ) (
) _ )
( \_
_(_\ \)__
(____\___))"
else
command git "$@"
fi;
}