DEV Community

Cover image for Generating shorter aliases from .gitconfig file

Posted on • Updated on


Generating shorter aliases from .gitconfig file

In previous articles I showed how to configure aliases in your ~/.gitconfig file.

As you might have noticed you need to type git alias which might be inconvenient. Even if you make an alias g=git you have to remember to type space between g and alias.

To make things easier we can automatically generate shell aliases from the .gitconfig file:

here we grep all the git config values from alias section and get the alias name with sed. Then we check that alias g + alias name doesn't already exist and set it.

Now, if you had for instance alias a = add you can type both g a and ga.

That's it.

Top comments (0)

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.