Can git display a list of all of your current aliases like bash's `alias` command?
-- In Christ, Timmy V. http://burningones.com/ http://five.sentenc.es/ - Spend less time on e-mail
Can git display a list of all of your current aliases like bash's `alias` command?
-- In Christ, Timmy V. http://burningones.com/ http://five.sentenc.es/ - Spend less time on e-mail
Re: Displaying Current Git Aliases
El 25/6/2009, a las 17:59, Tim Visher escribió:
> Can git display a list of all of your current aliases like bash's > `alias` command?
Something like:
git config --list | grep alias
Cheers, Wincent
Re: Displaying Current Git Aliases
Hi,
On Thu, 25 Jun 2009, Wincent Colaiuta wrote:
> El 25/6/2009, a las 17:59, Tim Visher escribió: > > > Can git display a list of all of your current aliases like bash's > > `alias` command? > > Something like: > > git config --list | grep alias
Or without a pipe (so you catch the exit status of git config easily):
git config --get-regexp ^alias\\.
Ciao, Dscho
Re: Displaying Current Git Aliases
On 2009-06-25 11:59 (-0400), Tim Visher wrote:
> Can git display a list of all of your current aliases like bash's > `alias` command?
I guess not directly but:
git config -l | grep ^alias
Re: Displaying Current Git Aliases
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.
-- Jakub Narebski Poland ShadeHawk on #git
Re: Displaying Current Git Aliases
>>>>> "Jakub" == Jakub Narebski <jnareb@gmail.com> writes:
Jakub> Tim Visher <tim.visher@gmail.com> writes:
>> Can git display a list of all of your current aliases like bash's >> `alias` command?
Jakub> In ~/.gitconfig:
Jakub> [alias] Jakub> alias = config --get-regexp ^alias\\.
But then it shows itself. :)
-- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
Re: Displaying Current Git Aliases
Hi,
On Thu, 25 Jun 2009, Randal L. Schwartz wrote:
> >>>>> "Jakub" == Jakub Narebski <jnareb@gmail.com> writes: > > Jakub> Tim Visher <tim.visher@gmail.com> writes: > >> Can git display a list of all of your current aliases like bash's > >> `alias` command? > > Jakub> In ~/.gitconfig: > > Jakub> [alias] > Jakub> alias = config --get-regexp ^alias\\. > > But then it shows itself. :)
Which is correct.
Ciao, Dscho
Re: Displaying Current Git Aliases
Thanks everyone.
On Thu, Jun 25, 2009 at 12:57 PM, Johannes Schindelin<Johannes.Schindelin@gmx.de> wrote:
> Hi, > > On Thu, 25 Jun 2009, Randal L. Schwartz wrote: > >> >>>>> "Jakub" == Jakub Narebski <jnareb@gmail.com> writes: >> >> Jakub> Tim Visher <tim.visher@gmail.com> writes: >> >> Can git display a list of all of your current aliases like bash's >> >> `alias` command? >> >> Jakub> In ~/.gitconfig: >> >> Jakub> [alias] >> Jakub> alias = config --get-regexp ^alias\\. >> >> But then it shows itself. :) > > Which is correct. > > Ciao, > Dscho > >
-- In Christ, Timmy V. http://burningones.com/ http://five.sentenc.es/ - Spend less time on e-mail
Re: Displaying Current Git Aliases
On Thu, Jun 25, 2009 at 12:33 PM, Jakub Narebski<jnareb@gmail.com> wrote:
> 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.