David Brower David Brower - 1 year ago 255
Git Question

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 "g s" 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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download