When setting alias in git, how to set the command with parameters?
For example, I have the command: git log --all | grep "parameters"
My existing alias method is: alog = log --all
When used, it is: git alog | grep "parameters"
I want to know if there is a better way, you can merge grep into the alias, so that When using it, you only need to enter the alias parameter?
The alias of git can only be set in git. prep is not a git command, so it will not work.
If you need to use this command, you can set a shell alias.
For example
When using
(Note that there is no git in front, because this is not an alias of git, but an alias of shell)
Recommend oh-my-zsh
You can define an sh function as an alias, such as