Re: Displaying Current Git Aliases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 25, 2009 at 12:33 PM, Jakub Narebski<jnareb@xxxxxxxxx> wrote:
> Tim Visher <tim.visher@xxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]