别名git stash poop流行?

jgi*_*man 25 git command-line command-line-interface

这是一个公认的愚蠢问题,但老实说我不知道​​这是否可行.

我经常输错"git stash pop"(从不介意为什么).我可以将我的拼写错误/快捷/别名映射到它应该是什么吗?

ysd*_*sdx 16

定义shell函数:

git() {
  if [ "$1" == "stash" -a "$2" == "poop" ]; then
    shift; shift; command git stash pop "$@"
  else
    command git "$@"
  fi
}
Run Code Online (Sandbox Code Playgroud)


mil*_*lan 14

git config --global alias.sp 'stash pop'
Run Code Online (Sandbox Code Playgroud)

然后git sp扩展到git stash pop


Sup*_*nja 10

对于那些需要正确生成的输出...

if [ "$1" == "stash" -a "$2" == "poop" ]
  then
      command git stash pop
      echo "
   )  )
  (   ) (
   ) _   )
    ( \_
  _(_\ \)__
 (____\___))"
  else
      command git "$@"
  fi;
}
Run Code Online (Sandbox Code Playgroud)