说我有以下git_branch_name
函数:
$ echo git_branch_name
master
$ git pull origin (git_branch_name) // Pulls origin master
如何在缩写中使用该功能?
这是我尝试过的:
abbr -a ggl git pull origin (git_branch_name)
不幸的是,它在缩写的定义期间内插(git_branch_name)
。
答案 0 :(得分:3)
如果您想推迟替换,只需在定义缩写时用引号引起来即可:
abbr -a ggl 'git pull origin (git_branch_name)'