There are some aliases that I use less frequently and want to check before I execute.
How can I easily search my git
aliases?
Add to your .gitconfig
under [alias]
:
aliases = !git config --list | grep ^alias\\. | cut -c 7- | grep -Ei --color \"$1\" "#"
Then you can do
git aliases commit
- show aliases containing "commit"git aliases ^st=
- show what the st
alias does git aliases
- show ALL aliasesThe first argument is an (optional) POSIX extended regular expression. Any additional arguments are ignored.
git --list-cmds=alias
lists all aliases.[1] So you can for example pipe that to grep
:
git --list-cmds=alias | grep log
man git
as of git version 2.40.0
: “This is an internal/experimental option and may change or be removed in the future.”If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With