我使用 Bash 来处理 Git,并且使用 Git 和 Bash 别名的组合,能够为 git 状态执行诸如“g s”之类的命令。
安装 cmder 后,我可以为 git 设置别名。但是,我无法使用“g”别名执行 git 命令 - 我只是获得了 git 使用页面。我可以运行“git s”(所以它使用我的全局 gitconfig 文件作为 git 别名)。因此,通过 cmder 我可以访问它的别名以及 git 别名,但我似乎无法将它们一起使用。
使用 bash 我似乎没有问题。
Apparently cmder uses the default convention of having a $
as an argument variable.
Thus, in my case, to make git=g
I put:
alias g=git $*
Run Code Online (Sandbox Code Playgroud)
in order for git to handle any and all arguments.
I had been struggling for a month on and off, only to (rather embarrasingly) find it on the homepage for cmder (http://cmder.net/)
At the bottom of said page it has a small section on Aliases. You'll find my source there...
归档时间: |
|
查看次数: |
1889 次 |
最近记录: |