How do I print a list of my git aliases, i.e., something analogous to the bash
Just adding this because it's so simple and I didn't see it in previous answers (sorry if I missed it).
git help -a
You'll have to scroll to the bottom to see the list, e.g.:
Command aliases restore-deleted !git restore $(git ls-files -d)
If you forget even this switch, a simple
git help will help you remember:
'git help -a' and 'git help -g' list available subcommands and some concept guides. See 'git help ' or 'git help ' to read about a specific subcommand or concept.
git help -adisplays in
lessfor me, so I can type
>to jump to the last line. Or you can just run
git help -a | sed '1,/aliases$/d'. I added that command as an alias in my global Git configuration file by running
git config --global alias.alias "\!git help -a | sed '1,/aliases$/d'". Now I can just run
git aliasto list my Git aliases. — Sep 02, 2022 at 21:38