简体   繁体   中英

Using a git alias from cmder

I use Bash to work with Git and, using a combination of Git and Bash aliases, am able to execute commands like "gs" for git status.

Having installed cmder I am able to set an alias for git. However, I am unable to execute a git command using the "g" alias - I just get the git usage page. I can run "git s" (so it is using my global gitconfig file for the git aliases). So through cmder I have access to both its aliases as well as the git aliases but I can't seem to use them together.

With bash I don't seem to have a problem.

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 $*

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM