I created a bunch of alias shortcuts. I want to rename one of them. For example, let's create alias al
which will display all the aliases that are already defined in my configuration file:
git config --global alias.al '!git config --list | grep ^alias\.'
My alias is now saved in the configuration and it looks like this:
alias.al=!git config --list | grep ^alias\.
I can call it by simply typing in git al
.
How do I rename this alias? For example, from 'al' to only 'l'? I could of course use:
git config --global --unset alias.al
And then type:
git config --global alias.l '!git config --list | grep ^alias\.'
But is there a way to do it in one simple command instead, without using --unset
?
To directly answer your question, I doubt this can be done in one command.
I'd recommend using your favorite editor and editing the .gitconfig
file. Since this is a global alias, it would be in your home directory:
vim ~/.gitconfig
You can easily change the aliases in there.
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