Re: Displaying Current Git Aliases
On Thu, Jun 25, 2009 at 12:33 PM, Jakub Narebski<jnareb@gmail.com> wrote:
Show 12 quoted lines
> Tim Visher <tim.visher@gmail.com> writes:
>
>> Can git display a list of all of your current aliases like bash's
>> `alias` command?
>
> In ~/.gitconfig:
>
> [alias]
> alias = config --get-regexp ^alias\\.
>
> Then you can simply use "git alias" to get list of all of your current
> aliases.
I have a considerably more insane alias alias that is to my liking:
# emit an alias if given one, else pretty prints all aliases
alias = "! sh -c 'case $# in \
0) git config --get-regexp \"^alias\\.\" \
| sort | sed \"s/^alias\\.//; s/=/ /\" \
| while read n v; do \
printf \"%-16s\" \"$n\"; \
echo \"$v\" | fmt -sw 63 | sed \"2,$ s/^/\t\t/\" ;\
done ;; \
1) git config \"alias.$1\" | fmt -sw 78 ;; esac' -":-)
j.